Files
gallery/weather/route/api.py

13 lines
331 B
Python

import datetime
from fastapi import FastAPI
from weather.api import get_api
from weather.model import WeatherResponse
def mount(app: FastAPI):
@app.get("/api/weather/{location}/{date}")
async def get_weather(location: str, date: datetime.date) -> WeatherResponse:
return await get_api().get_day(location, date)