hv2-all-in-one/api/server.py

19 lines
421 B
Python
Raw Permalink Normal View History

2021-08-02 16:52:31 +02:00
import connexion
from flask_cors import CORS
# instantiate the webservice
app = connexion.App(__name__)
2021-09-11 19:19:16 +02:00
app.add_api('openapi.yaml', options = {"swagger_ui": False})
2021-08-02 16:52:31 +02:00
# CORSify it - otherwise Angular won't accept it
2021-09-11 18:50:54 +02:00
CORS(app.app,
origins=[
"http://localhost:4200",
"https://base.hv.nober.de"
],
supports_credentials=True
)
2021-08-02 16:52:31 +02:00
# provide the webservice application to uwsgi
application = app.app