-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.py
36 lines (26 loc) · 1.22 KB
/
app.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# ------------------------------------------------------------------------------
# zbMATH links API (Flask + Swagger + Flask-RESTPlus)
# ------------------------------------------------------------------------------
from flask import Blueprint, Flask
from zb_links import configure_app, initialize_db
from zb_links.api.link.links import ns as links_namespace
from zb_links.api.link.partners import ns as partners_namespace
from zb_links.api.link.source import ns as source_namespace
from zb_links.api.link.statistics_msc import ns as statistics_msc_namespace
from zb_links.api.link.statistics_years import ns as statistics_years_namespace
from zb_links.api.restx import api
def initialize_app(flask_app):
configure_app(flask_app)
blueprint = Blueprint("links_api", __name__, url_prefix="/links_api")
api.init_app(blueprint)
api.add_namespace(partners_namespace)
api.add_namespace(links_namespace)
api.add_namespace(source_namespace)
api.add_namespace(statistics_msc_namespace)
api.add_namespace(statistics_years_namespace)
flask_app.register_blueprint(blueprint)
def create_app():
application = Flask(__name__)
initialize_app(application)
initialize_db(application)
return application