-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstart_app.py
39 lines (26 loc) · 976 Bytes
/
start_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
37
38
39
#!/usr/bin/python3
# coding: utf-8
from __future__ import unicode_literals
"""
ERTIM - INALCO : TECHNIQUES WEB (REST API)
-------------------------------------------
This module run API.
:copyright: © 2020 by Elvis.
:license: Creative Commons, see LICENSE for more details.
"""
__version__ = "0.1"
from flask import Flask
from werkzeug.middleware.dispatcher import DispatcherMiddleware
from front.app import ceptyDataFront as frontend
from cepty.api import ceptyDataApi as backend
# ------------------------------------------------------------------
application = DispatcherMiddleware(frontend, {
'/api': backend
})
cepty_app = Flask(__name__)
cepty_app.wsgi_app = application
# ------------------------------------------------------------------
if __name__ == '__main__':
from os import environ
cepty_app.run(host='0.0.0.0', port=environ['PORT'], use_evalex=True,
use_reloader=True, use_debugger=True)