2026-07-16 13:47:37 +08:00
|
|
|
from fastapi import FastAPI
|
|
|
|
|
|
|
|
|
|
from app.api.v1.router import api_router
|
|
|
|
|
from app.core.config import get_settings
|
|
|
|
|
from app.core.logging import configure_logging, setup_request_logging
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def create_app() -> FastAPI:
|
|
|
|
|
settings = get_settings()
|
|
|
|
|
configure_logging(settings)
|
|
|
|
|
|
|
|
|
|
app = FastAPI(title=settings.app_name)
|
|
|
|
|
setup_request_logging(app)
|
2026-07-21 10:09:36 +08:00
|
|
|
app.include_router(api_router, prefix=settings.route_prefix)
|
2026-07-16 13:47:37 +08:00
|
|
|
return app
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
app = create_app()
|