refactor: remove all inline comments from code
This commit is contained in:
16
app/main.py
16
app/main.py
@@ -1,5 +1,3 @@
|
||||
"""FastAPI application factory and entry point."""
|
||||
|
||||
from contextlib import asynccontextmanager
|
||||
|
||||
import uvicorn
|
||||
@@ -11,32 +9,18 @@ from app.core.config import settings
|
||||
|
||||
@asynccontextmanager
|
||||
async def lifespan(app: FastAPI):
|
||||
"""Application lifespan manager for startup/shutdown events."""
|
||||
# Startup: initialize DB connections, cache, etc.
|
||||
yield
|
||||
# Shutdown: cleanup resources
|
||||
|
||||
|
||||
def app_factory() -> FastAPI:
|
||||
"""Create and configure FastAPI application instance.
|
||||
|
||||
Returns:
|
||||
Configured FastAPI application.
|
||||
"""
|
||||
app = FastAPI(title=settings.app_name, debug=settings.debug, lifespan=lifespan)
|
||||
|
||||
# Register exception handlers
|
||||
register_exception_handlers(app)
|
||||
|
||||
# Register routers (when added)
|
||||
# from app.api.v1.router import api_router
|
||||
# app.include_router(api_router, prefix="/api/v1")
|
||||
|
||||
return app
|
||||
|
||||
|
||||
def main():
|
||||
"""Run the application with uvicorn server."""
|
||||
uvicorn.run(app_factory, factory=True, host=settings.host, port=settings.port)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user