dwm-app/app.py

42 lines
1.1 KiB
Python
Raw Normal View History

from flask import Flask, render_template
2024-02-28 20:27:44 +00:00
from api.get_monsters import *
from api.get_families import *
from api.get_monster_stats import *
from api.get_breeding_pairs import *
from api.get_breeding_usage import *
from api.get_skills_data import *
from utils.utils import *
from utils.serve_media import *
2024-02-28 20:52:15 +00:00
from utils.data_sources import *
2024-02-14 20:55:41 +00:00
app = Flask(__name__)
2024-01-30 16:06:00 +00:00
# Utils
app.before_request(before_request)
app.teardown_request(teardown_request)
2024-02-28 20:55:09 +00:00
app.register_blueprint(serve_media)
2024-02-02 02:52:59 +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-22 03:23:13 +00:00
app.register_blueprint(get_breeding_pairs_bp)
2024-02-22 15:58:22 +00:00
app.register_blueprint(get_breeding_usage_bp)
2024-02-28 20:01:43 +00:00
app.register_blueprint(get_skills_data_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():
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
@app.route('/skills')
def skills():
2024-02-28 20:52:15 +00:00
csv_data = read_skills_csv('static/data/skills_data.csv')
return render_template('skills.html', csv_data=csv_data)
2024-01-30 23:21:26 +00:00
if __name__ == "__main__":
2024-01-30 16:06:00 +00:00
app.run(debug=True)