22 lines
429 B
Python
22 lines
429 B
Python
import locale
|
|
|
|
from fastapi import FastAPI
|
|
|
|
from weather.api import WeatherApi
|
|
|
|
from .route import api, doc, view
|
|
|
|
|
|
def build_app(weather_api: WeatherApi) -> FastAPI:
|
|
locale.setlocale(locale.LC_TIME, "ru_RU.UTF-8")
|
|
app = FastAPI(
|
|
title="Weather",
|
|
docs_url=None,
|
|
redoc_url=None,
|
|
)
|
|
app.state.weather_api = weather_api
|
|
doc.mount(app)
|
|
api.mount(app)
|
|
view.mount(app)
|
|
return app
|