etiquette/etiquette_launch.py

30 lines
638 B
Python
Raw Normal View History

2016-11-27 09:06:11 +00:00
import gevent.monkey
gevent.monkey.patch_all()
2016-09-18 08:33:46 +00:00
import etiquette
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(
2016-11-27 09:06:11 +00:00
listener=('', port),
application=etiquette.site,
keyfile='C:\\git\\etiquette\\etiquette\\https\\etiquette.key',
certfile='C:\\git\\etiquette\\etiquette\\https\\etiquette.crt',
2016-09-18 08:33:46 +00:00
)
else:
2016-11-27 09:06:11 +00:00
http = gevent.pywsgi.WSGIServer(
listener=('', port),
application=etiquette.site,
)
2016-09-18 08:33:46 +00:00
print('Starting server on port %d' % port)
2016-12-16 11:27:39 +00:00
http.serve_forever()