main.py 552 B

123456789101112131415161718
  1. #!/usr/bin/env python
  2. # -*- encoding: utf-8 -*-
  3. """
  4. @Contact : liuyuqi.gov@msn.cn
  5. @Time : 2024/04/09 12:48:43
  6. @License : Copyright © 2017-2022 liuyuqi. All Rights Reserved.
  7. @Desc : enter point
  8. """
  9. from fgh import create_app
  10. app = create_app()
  11. if __name__=='__main__':
  12. # app.run(host="127.0.0.1", port=8080, debug=True)
  13. # 注意:flask支持wsgi,uvicorn是asgi,转换一下协议
  14. import uvicorn
  15. from asgiref.wsgi import WsgiToAsgi
  16. asgi_app = WsgiToAsgi(app)
  17. uvicorn.run(asgi_app, host="0.0.0.0", port=8080,)