2024-02-15 22:01:53 +00:00
|
|
|
from flask import Flask, render_template
|
2024-02-15 15:09:54 +00:00
|
|
|
|
2024-02-15 15:46:33 +00:00
|
|
|
from src.util.utils import *
|
|
|
|
|
2024-02-15 15:09:54 +00:00
|
|
|
from src.api.get_monsters import *
|
|
|
|
from src.api.get_families import *
|
|
|
|
from src.api.get_monster_stats import *
|
2024-01-30 16:06:00 +00:00
|
|
|
|
2024-02-15 15:09:54 +00:00
|
|
|
from src.views.serve_content import *
|
2024-02-15 22:01:53 +00:00
|
|
|
from src.views.monster_stats import *
|
|
|
|
from src.views.breed_info import *
|
|
|
|
from src.views.skills import *
|
2024-02-15 15:09:54 +00:00
|
|
|
|
2024-02-14 20:55:41 +00:00
|
|
|
app = Flask(__name__)
|
2024-01-30 16:06:00 +00:00
|
|
|
|
2024-02-15 15:09:54 +00:00
|
|
|
# Utils
|
2024-02-15 13:42:34 +00:00
|
|
|
app.before_request(before_request)
|
|
|
|
app.teardown_request(teardown_request)
|
2024-02-02 02:52:59 +00:00
|
|
|
|
2024-02-15 15:09:54 +00:00
|
|
|
# Register API Blueprints
|
|
|
|
app.register_blueprint(get_families_bp)
|
|
|
|
app.register_blueprint(get_monsters_bp)
|
|
|
|
app.register_blueprint(get_monster_stats_bp)
|
|
|
|
|
2024-02-15 15:46:33 +00:00
|
|
|
# Register Serve Content Blueprints
|
2024-02-21 13:26:28 +00:00
|
|
|
app.register_blueprint(serve_img_bp)
|
2024-02-15 15:46:33 +00:00
|
|
|
|
|
|
|
# Register Other Views Blurprints (HTML Render Templates)
|
2024-02-15 22:01:53 +00:00
|
|
|
app.register_blueprint(breed_info_bp)
|
|
|
|
app.register_blueprint(skills_bp)
|
2024-02-15 15:46:33 +00:00
|
|
|
|
2024-02-02 02:52:59 +00:00
|
|
|
@app.route("/")
|
2024-02-04 20:21:15 +00:00
|
|
|
def show_app():
|
2024-02-01 21:57:44 +00:00
|
|
|
js_files = get_js_files()
|
2024-02-04 20:21:15 +00:00
|
|
|
return render_template("app.html", js_files=js_files)
|
2024-01-30 16:06:00 +00:00
|
|
|
|
2024-01-30 23:21:26 +00:00
|
|
|
if __name__ == "__main__":
|
2024-01-30 16:06:00 +00:00
|
|
|
app.run(debug=True)
|