etiquette/frontends/etiquette_flask/etiquette_flask_launch.py
Ethan Dalool 1c30ef5785 Further separate front & back; Create frontends folder
New frontends folder will hold all front-end interfaces for etiquette. Existing flask site moved here and refers to itself as a package with external launcher. etiquette_site renamed to etiquette_flask
2017-05-01 21:49:28 -07:00

29 lines
670 B
Python

import gevent.monkey
gevent.monkey.patch_all()
import etiquette_flask
import gevent.pywsgi
import gevent.wsgi
import sys
if len(sys.argv) == 2:
port = int(sys.argv[1])
else:
port = 5000
if port == 443:
http = gevent.pywsgi.WSGIServer(
listener=('0.0.0.0', port),
application=etiquette_flask.site,
keyfile='C:\\git\\etiquette\\etiquette\\https\\etiquette.key',
certfile='C:\\git\\etiquette\\etiquette\\https\\etiquette.crt',
)
else:
http = gevent.pywsgi.WSGIServer(
listener=('0.0.0.0', port),
application=etiquette_flask.site,
)
print('Starting server on port %d' % port)
http.serve_forever()