[15a331]: / src / app.py

Download this file

23 lines (15 with data), 687 Bytes

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
"""Main application module for the stroke risk predictor."""
import os
import sys
project_root = os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))
sys.path.insert(0, project_root)
from flask import Flask, render_template # pylint: disable=wrong-import-position
from src.api.predict import predict_bp # pylint: disable=wrong-import-position
app = Flask(__name__, template_folder="../templates", static_folder="../static")
app.register_blueprint(predict_bp, url_prefix="/api")
@app.route("/", methods=["GET"])
def index():
"""Renders the main page of the application."""
return render_template("index.html")
if __name__ == "__main__":
app.run(debug=True)