feat: split to weather and gismeteo modules
This commit is contained in:
27
weather/app.py
Normal file
27
weather/app.py
Normal file
@@ -0,0 +1,27 @@
|
||||
import locale
|
||||
from os import environ
|
||||
|
||||
import uvicorn
|
||||
from fastapi import FastAPI
|
||||
|
||||
from gismeteo.api import GismeteoApi
|
||||
|
||||
from . import api as _api
|
||||
from .route import api, doc, view
|
||||
|
||||
_api.DEFAULT_API = GismeteoApi()
|
||||
|
||||
locale.setlocale(locale.LC_TIME, "ru_RU.UTF-8")
|
||||
|
||||
app = FastAPI(
|
||||
title="Weather",
|
||||
docs_url=None,
|
||||
redoc_url=None,
|
||||
)
|
||||
doc.mount(app)
|
||||
api.mount(app)
|
||||
view.mount(app)
|
||||
|
||||
|
||||
def run():
|
||||
uvicorn.run("weather.app:app", host="0.0.0.0", port=8000, reload="DEBUG" in environ)
|
||||
Reference in New Issue
Block a user