
- Set up project structure with FastAPI - Implement user and account management - Add send and receive money functionality - Set up transaction processing system - Add JWT authentication - Configure SQLAlchemy with SQLite - Set up Alembic for database migrations - Create comprehensive API documentation
22 lines
600 B
Python
22 lines
600 B
Python
from fastapi import APIRouter, Depends
|
|
from sqlalchemy.orm import Session
|
|
|
|
from app.db.session import get_db
|
|
|
|
router = APIRouter()
|
|
|
|
|
|
@router.get("")
|
|
def health_check(db: Session = Depends(get_db)):
|
|
"""
|
|
Check the health of the application.
|
|
|
|
This endpoint can be used to verify that the application is running
|
|
and able to connect to the database.
|
|
"""
|
|
try:
|
|
# Try to execute a simple query
|
|
db.execute("SELECT 1")
|
|
return {"status": "healthy", "database": "connected"}
|
|
except Exception as e:
|
|
return {"status": "unhealthy", "database": str(e)} |