from fastapi import FastAPI from fastapi.middleware.cors import CORSMiddleware from app.api.routes import auth, health from app.db.session import engine from app.db.base import Base app = FastAPI( title="User Authentication Service", description="A FastAPI service for user authentication", version="1.0.0", openapi_url="/openapi.json" ) app.add_middleware( CORSMiddleware, allow_origins=["*"], allow_credentials=True, allow_methods=["*"], allow_headers=["*"], ) Base.metadata.create_all(bind=engine) app.include_router(auth.router, prefix="/auth", tags=["authentication"]) app.include_router(health.router, tags=["health"]) @app.get("/") async def root(): return { "title": "User Authentication Service", "documentation": "/docs", "health_check": "/health" }