2017-05-12 18:51:49 +00:00
|
|
|
#!/usr/bin/python3
|
|
|
|
# -*- coding: utf-8 -*-
|
|
|
|
import gevent.monkey
|
|
|
|
gevent.monkey.patch_all()
|
|
|
|
|
2017-08-01 18:02:08 +00:00
|
|
|
from nyaa import create_app
|
2017-05-12 18:51:49 +00:00
|
|
|
|
2017-08-01 18:02:08 +00:00
|
|
|
app = create_app('config')
|
|
|
|
|
|
|
|
if app.config['DEBUG']:
|
|
|
|
from werkzeug.debug import DebuggedApplication
|
|
|
|
app.wsgi_app = DebuggedApplication(app.wsgi_app, True)
|
2017-05-12 18:51:49 +00:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2017-08-01 18:02:08 +00:00
|
|
|
import gevent.pywsgi
|
|
|
|
gevent_server = gevent.pywsgi.WSGIServer(("localhost", 5000), app.wsgi_app)
|
|
|
|
gevent_server.serve_forever()
|