20 lines
592 B
Python
20 lines
592 B
Python
|
|
"""FastAPI application factory."""
|
||
|
|
|
||
|
|
from fastapi import FastAPI
|
||
|
|
|
||
|
|
from zhixing_server.bootstrap.config import get_settings
|
||
|
|
from zhixing_server.interfaces.http.router import api_v1_router, operational_router
|
||
|
|
|
||
|
|
|
||
|
|
def create_app() -> FastAPI:
|
||
|
|
"""Compose the HTTP application without leaking FastAPI into domain modules.
|
||
|
|
|
||
|
|
Returns:
|
||
|
|
A configured FastAPI application instance.
|
||
|
|
"""
|
||
|
|
settings = get_settings()
|
||
|
|
application = FastAPI(title=settings.app_name)
|
||
|
|
application.include_router(operational_router)
|
||
|
|
application.include_router(api_v1_router)
|
||
|
|
return application
|