feat: add database configuration and health check
This commit is contained in:
parent
3d53a94d59
commit
3701c50711
9 changed files with 72 additions and 2 deletions
|
|
@ -1,5 +1,7 @@
|
|||
from fastapi import FastAPI
|
||||
|
||||
from app.db.health import check_database
|
||||
|
||||
app = FastAPI(
|
||||
title="Hermes API",
|
||||
version="0.1.0",
|
||||
|
|
@ -9,9 +11,15 @@ app = FastAPI(
|
|||
|
||||
@app.get("/")
|
||||
def root():
|
||||
return {"service": "Hermes", "status": "running"}
|
||||
return {
|
||||
"service": "Hermes",
|
||||
"status": "running"
|
||||
}
|
||||
|
||||
|
||||
@app.get("/health")
|
||||
def health():
|
||||
return {"status": "healthy"}
|
||||
return {
|
||||
"status": "healthy",
|
||||
"database": check_database()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue