main.py 625 B

1234567891011121314151617181920212223242526
  1. from configure import configure
  2. import os
  3. import logging
  4. env_dict = os.environ
  5. hblog_conf = env_dict.get("hblog_conf")
  6. if hblog_conf is None:
  7. logging.info("Configure file ./etc/conf.json")
  8. configure("./etc/conf.json")
  9. else:
  10. logging.info(f"Configure file {hblog_conf}")
  11. configure(hblog_conf)
  12. from sql.cache import restart_clear_cache
  13. restart_clear_cache() # 清理缓存
  14. from app import HBlogFlask
  15. from waitress import serve
  16. app = HBlogFlask(__name__)
  17. app.register_all_blueprint()
  18. if __name__ == '__main__':
  19. logging.info("Server start on 127.0.0.1:8080")
  20. serve(app, host='0.0.0.0', port="8080")