Refactoring of namespace and blueprints
This commit is contained in:
parent
8c5a6d9743
commit
1d5016c176
@ -1,4 +1,3 @@
|
|||||||
from flask_restx import Namespace
|
from flask import Blueprint
|
||||||
|
|
||||||
namespace = Namespace('mre',
|
blueprint = Blueprint('mre', __name__)
|
||||||
description='Endpoints for MRE calculations')
|
|
||||||
|
|||||||
@ -0,0 +1,6 @@
|
|||||||
|
from flask_restx import Namespace
|
||||||
|
|
||||||
|
namespace = Namespace(
|
||||||
|
'mre',
|
||||||
|
description='API endpoints for MRE calculations.'
|
||||||
|
)
|
||||||
@ -1,6 +1,6 @@
|
|||||||
from flask import Flask
|
from flask import Flask
|
||||||
import os
|
import os
|
||||||
from app.MRE import mre_blueprint
|
from app.MRE import blueprint as mre_blueprint
|
||||||
from .api import blueprint as api_blueprint
|
from .api import blueprint as api_blueprint
|
||||||
from logging import Logger, Formatter, getLogger, DEBUG, INFO, FileHandler
|
from logging import Logger, Formatter, getLogger, DEBUG, INFO, FileHandler
|
||||||
|
|
||||||
|
|||||||
12
app/api.py
Normal file
12
app/api.py
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
from flask_restx import Api
|
||||||
|
from flask import Blueprint
|
||||||
|
from .MRE.api import namespace as mre_namespace
|
||||||
|
|
||||||
|
blueprint = Blueprint('api', __name__)
|
||||||
|
api = Api(
|
||||||
|
blueprint,
|
||||||
|
doc='/doc/',
|
||||||
|
title='Quarter API documentatoin'
|
||||||
|
)
|
||||||
|
api.add_namespace(mre_namespace, '/mre')
|
||||||
|
|
||||||
Loading…
Reference in New Issue
Block a user