24 lines
498 B
Python
24 lines
498 B
Python
import locale as _locale
|
|
|
|
from fastapi import FastAPI
|
|
|
|
from gallery.sketch.bundle import ApiBundle
|
|
|
|
from .route import api, doc, view
|
|
|
|
DEFAULT_LOCALE = "ru_RU.UTF-8"
|
|
|
|
|
|
def build_app(api_bundle: ApiBundle, *, locale: str = DEFAULT_LOCALE) -> FastAPI:
|
|
_locale.setlocale(_locale.LC_TIME, locale)
|
|
app = FastAPI(
|
|
title="Gallery",
|
|
docs_url=None,
|
|
redoc_url=None,
|
|
)
|
|
app.state.api = api_bundle
|
|
doc.mount(app)
|
|
api.mount(app)
|
|
view.mount(app)
|
|
return app
|