refactor(weather.app): move routes to weather.app module

This commit is contained in:
2024-07-29 00:50:25 +03:00
parent 1fb627110d
commit 22fab7a15a
17 changed files with 31 additions and 9 deletions

22
weather/app/__init__.py Normal file
View File

@@ -0,0 +1,22 @@
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