Files
gallery/weather/app/__init__.py

23 lines
430 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