MIL-002: backend basics and Hello Flask #33

Merged
Tirsvad merged 5 commits from mil-002-hello-flask into main 2026-11-06 05:36:43 +01:00
2 changed files with 30 additions and 0 deletions
Showing only changes of commit 2f862f29e3 - Show all commits

No files matched your search

@@ -0,0 +1,12 @@
## @file get_greeting.py
# @brief Use case that provides the greeting.
"""Use case that provides the greeting."""
from flask_day_54.domain.constants import GREETING
## @brief Return the greeting to show the user.
# @return The greeting text.
def get_greeting() -> str:
"""Return the greeting to show the user."""
return GREETING
+18
View File
@@ -0,0 +1,18 @@
## @file hello.py
# @brief The minimal Flask application of lectures 1 and 2.
"""The minimal Flask application of lectures 1 and 2."""
from flask import Flask
from flask_day_54.application.get_greeting import get_greeting
## @brief The Flask application object.
app = Flask(__name__)
## @brief Handle GET / and answer with the greeting.
# @return The greeting as the response body.
@app.route("/")
def hello_world() -> str:
"""Answer the root route with the greeting."""
return get_greeting()