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',
|
||||
description='Endpoints for MRE calculations')
|
||||
blueprint = Blueprint('mre', __name__)
|
||||
|
||||
@ -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
|
||||
import os
|
||||
from app.MRE import mre_blueprint
|
||||
from app.MRE import blueprint as mre_blueprint
|
||||
from .api import blueprint as api_blueprint
|
||||
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