22 lines
648 B
Python
22 lines
648 B
Python
"""FastAPI application entrypoint."""
|
|
|
|
from fastapi import FastAPI
|
|
|
|
from app.config import Settings, get_settings
|
|
from app.controllers.middleware import install_middleware
|
|
from app.controllers.v1.delivery import router as delivery_router
|
|
|
|
|
|
def create_app(settings: Settings | None = None) -> FastAPI:
|
|
resolved_settings = settings or get_settings()
|
|
|
|
application = FastAPI(title="G2S Aggregator", version="0.1.0")
|
|
application.state.settings = resolved_settings
|
|
|
|
install_middleware(application)
|
|
application.include_router(delivery_router, prefix=resolved_settings.controller.api_prefix)
|
|
return application
|
|
|
|
|
|
app = create_app()
|