Refactoring code for modular approach
This commit is contained in:
10
main.py
10
main.py
@@ -13,16 +13,16 @@ logger = logging.getLogger(__name__)
|
||||
|
||||
# FastAPI app with lifespan
|
||||
app = FastAPI(
|
||||
title=settings.PROJECT_NAME,
|
||||
description=settings.DESCRIPTION,
|
||||
version=settings.VERSION,
|
||||
title=settings.project_name,
|
||||
description=settings.description,
|
||||
version=settings.version,
|
||||
lifespan=lifespan
|
||||
)
|
||||
|
||||
# Add CORS middleware
|
||||
app.add_middleware(
|
||||
CORSMiddleware,
|
||||
allow_origins=settings.ALLOWED_HOSTS,
|
||||
allow_origins=settings.allowed_hosts,
|
||||
allow_credentials=True,
|
||||
allow_methods=["*"],
|
||||
allow_headers=["*"],
|
||||
@@ -37,7 +37,7 @@ app.include_router(api_router, prefix="/api/v1")
|
||||
@app.get("/")
|
||||
def root():
|
||||
return {
|
||||
"message": f"{settings.PROJECT_NAME} v{settings.VERSION}",
|
||||
"message": f"{settings.project_name} v{settings.version}",
|
||||
"status": "operational",
|
||||
"docs": "/docs",
|
||||
"features": [
|
||||
|
||||
Reference in New Issue
Block a user