31 lines
757 B
Python

from fastapi import FastAPI
from fastapi.middleware.cors import CORSMiddleware
from app.api.auth import router as auth_router
app = FastAPI(
title="User Authentication Service",
description="A FastAPI service for user authentication",
version="1.0.0"
)
app.add_middleware(
CORSMiddleware,
allow_origins=["*"],
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
)
app.include_router(auth_router, prefix="/auth", tags=["authentication"])
@app.get("/")
def root():
return {
"title": "User Authentication Service",
"documentation": "/docs",
"health": "/health"
}
@app.get("/health")
def health_check():
return {"status": "healthy", "service": "User Authentication Service"}