def main(app: Flask, tornado: bool=False) -> None:
"""Run the Flask application."""
with app.app_context():
db.create_all()
print('[OK] Database creation complete.')
if tornado:
from tornado.wsgi import WSGIContainer
from tornado.httpserver import HTTPServer
from tornado.ioloop import IOLoop
http_server = HTTPServer(WSGIContainer(app))
http_server.listen(int(app.config['INIT_PORT']))
IOLoop.instance().start()
else:
socketio.run(app, **app.config['INIT'])
评论列表
文章目录