app.py 675 B

1234567891011121314151617181920212223242526272829303132333435
  1. from utils import conf
  2. from blues import com, idc
  3. from flask_cors import CORS
  4. from flask import Flask, render_template, Response
  5. def init() -> "Flask":
  6. this = Flask(__name__)
  7. CORS(this)
  8. this.config.from_object(conf)
  9. this.register_blueprint(com)
  10. this.register_blueprint(idc)
  11. return this
  12. app = init()
  13. @app.route("/")
  14. def index():
  15. return render_template("navigate.html")
  16. @app.route("/favicon.ico")
  17. def icon():
  18. with open("static/html/favicon.png", "rb") as f:
  19. img = f.read()
  20. f.close()
  21. return Response(img, mimetype="image/x-png")
  22. if __name__ == "__main__":
  23. app.run(host=conf.SERVER_HOST, port=conf.SERVER_PORT)