refactor(weather.app): move routes to weather.app module
This commit is contained in:
22
weather/app/__init__.py
Normal file
22
weather/app/__init__.py
Normal 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
|
||||
Reference in New Issue
Block a user