from flask import Flask, render_template

# Blueprints
from routes.territoires import territoires_bp
from routes.indicateurs import indicateurs_bp


app = Flask(__name__)


# -----------------------------
# Enregistrement des routes API
# -----------------------------

app.register_blueprint(territoires_bp, url_prefix="/api/territoires")
app.register_blueprint(indicateurs_bp, url_prefix="/api/indicateurs")


# -----------------------------
# Page principale
# -----------------------------

@app.route("/")
def dashboard():
    """
    Page principale du dashboard
    """
    return render_template("dashboard.html")


# -----------------------------
# Lancement serveur
# -----------------------------

if __name__ == "__main__":
    app.run(debug=True)