mirror of
https://github.com/sartography/uva-covid19-testing-communicator.git
synced 2025-02-21 19:38:25 +00:00
adding wsgi.py.
This commit is contained in:
parent
872cdfe0ef
commit
025c4a3391
23
wsgi.py
Normal file
23
wsgi.py
Normal file
@ -0,0 +1,23 @@
|
||||
from werkzeug.exceptions import NotFound
|
||||
from werkzeug.middleware.dispatcher import DispatcherMiddleware
|
||||
from werkzeug.middleware.proxy_fix import ProxyFix
|
||||
|
||||
from communicator import app
|
||||
|
||||
if __name__ == "__main__":
|
||||
def no_app(environ, start_response):
|
||||
return NotFound()(environ, start_response)
|
||||
|
||||
# Remove trailing slash, but add leading slash
|
||||
base_url = '/' + app.config['APPLICATION_ROOT'].strip('/')
|
||||
routes = {'/': app.wsgi_app}
|
||||
|
||||
if base_url != '/':
|
||||
routes[base_url] = app.wsgi_app
|
||||
|
||||
app.wsgi_app = DispatcherMiddleware(no_app, routes)
|
||||
app.wsgi_app = ProxyFix(app.wsgi_app)
|
||||
|
||||
flask_port = app.config['FLASK_PORT']
|
||||
|
||||
app.run(host='0.0.0.0', port=flask_port)
|
Loading…
x
Reference in New Issue
Block a user