Adding flask and heartbeat
This commit is contained in:
21
src/app.py
Normal file
21
src/app.py
Normal file
@@ -0,0 +1,21 @@
|
||||
from flask import Flask, jsonify
|
||||
from datetime import datetime, timezone
|
||||
|
||||
app = Flask(__name__)
|
||||
|
||||
|
||||
@app.get("/heartbeat")
|
||||
def heartbeat() -> tuple:
|
||||
return (
|
||||
jsonify(
|
||||
{
|
||||
"status": "ok",
|
||||
"timestamp": datetime.now(timezone.utc).isoformat(),
|
||||
}
|
||||
),
|
||||
200,
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
app.run(debug=True)
|
||||
Reference in New Issue
Block a user