Refactoring of namespace and blueprints

This commit is contained in:
Chris Diesch 2025-04-06 16:19:05 -06:00
parent 8c5a6d9743
commit 1d5016c176
4 changed files with 21 additions and 4 deletions

View File

@ -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__)

View File

@ -0,0 +1,6 @@
from flask_restx import Namespace
namespace = Namespace(
'mre',
description='API endpoints for MRE calculations.'
)

View File

@ -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
View 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')