main.py 506 B

12345678910111213141516171819202122232425
  1. from configure import configure
  2. import os
  3. env_dict = os.environ
  4. hblog_conf = env_dict.get("hblog_conf")
  5. if hblog_conf is None:
  6. print("执行配置文件: ./etc/conf.json")
  7. configure("./etc/conf.json")
  8. else:
  9. print(f"执行配置文件: {hblog_conf}")
  10. configure(hblog_conf)
  11. from view import WebApp
  12. from waitress import serve
  13. web = WebApp(__name__)
  14. app = web.get_app()
  15. if __name__ == '__main__':
  16. print("已启动服务: 127.0.0.1:8080")
  17. serve(app, host='0.0.0.0', port="8080")