from .VERSION import __version__ from flask import Flask from namex.utils.run_version import get_run_version from flask_jwt_oidc import JwtManager jwt = JwtManager() from namex.services.nro import NROServices nro = NROServices() from namex.models import db, ma from namex.resources import api from namex import models run_version = get_run_version() def create_app(run_mode=os.getenv('FLASK_ENV', 'production')): app = Flask(__name__) app.config.from_object(config.CONFIGURATION[run_mode]) db.init_app(app) ma.init_app(app) api.init_app(app) setup_jwt_manager(app, jwt) nro.init_app(app)
def get(): return jsonify(API="NameX/{ver}".format(ver=get_run_version()))