Skip to content
This repository was archived by the owner on Sep 12, 2025. It is now read-only.

Commit 28cd36e

Browse files
committed
Add basic Flask app
1 parent f25e4f1 commit 28cd36e

File tree

4 files changed

+37
-0
lines changed

4 files changed

+37
-0
lines changed

app.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
from app import create_app
2+
import os
3+
4+
app = create_app()
5+
6+
if __name__ == "__main__":
7+
app.run(debug=bool(os.environ.get("FLASK_DEBUG", False)))

app/__init__.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
from flask import Flask
2+
from app.routes import api
3+
4+
5+
def create_app():
6+
app = Flask(__name__)
7+
8+
app.register_blueprint(api, url_prefix="/api")
9+
10+
return app

app/routes.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
from flask import Blueprint, jsonify
2+
3+
api = Blueprint("api", __name__)
4+
5+
6+
@api.route("/status/health-check", methods=["GET"])
7+
def status_health_check():
8+
return jsonify({"status": "healthy"}), 200
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
from app import create_app
2+
3+
4+
def test_health_check():
5+
"""Responds with a 200 status code and a healthy status message."""
6+
app = create_app()
7+
client = app.test_client()
8+
9+
response = client.get('/api/status/health-check')
10+
11+
assert response.status_code == 200
12+
assert response.get_json() == {"status": "healthy"}

0 commit comments

Comments
 (0)