app.py 720 B

123456789101112131415161718192021222324252627282930313233343536
  1. from utils import conf
  2. from flask_cors import CORS
  3. from blues import com, idc, bank
  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. this.register_blueprint(bank)
  12. return this
  13. app = init()
  14. @app.route("/")
  15. def index():
  16. return render_template("navigate.html")
  17. @app.route("/favicon.ico")
  18. def icon():
  19. with open("static/html/icon/favicon.png", "rb") as f:
  20. img = f.read()
  21. f.close()
  22. return Response(img, mimetype="image/x-png")
  23. if __name__ == "__main__":
  24. app.run(host=conf.SERVER_HOST, port=conf.SERVER_PORT)