-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.py
45 lines (31 loc) · 1.05 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
37
38
39
40
41
42
43
from flask import *
import DocumentDbConfigurationExtractor
from paste.translogger import TransLogger
import cherrypy
from Controllers import api
from Middlewars import CorrelationId
import pydevd
# Bootstrapping code (db,web api,swagger, middleware)
#DocumentDbConfigurationExtractor.LoadDbCoonectionDetails()
app = Flask(__name__)
api.init_app(app)
app.before_request(CorrelationId.ExtractCorrelationId)
app.debug = True
def run_server():
# Enable WSGI access logging via Paste
app_logged = TransLogger(app)
# Mount the WSGI callable object (app) on the root directory
cherrypy.tree.graft(app_logged, '/')
# Set the configuration of the web server
cherrypy.config.update({
'engine.autoreload_on': True,
'log.screen': True,
'server.socket_port': 5000,
'server.socket_host': '0.0.0.0'
})
cherrypy.engine.start()
cherrypy.engine.block()
if __name__ == '__main__':
#pydevd.settrace('10.0.0.8', port=4444, stdoutToServer=True, stderrToServer=True)
run_server()
# app.run(debug=True)