diff --git a/src/routes/api/weather/+server.ts b/src/routes/api/weather/+server.ts new file mode 100644 index 0000000..b6c636d --- /dev/null +++ b/src/routes/api/weather/+server.ts @@ -0,0 +1,15 @@ +import fetchWeather from "$lib/clients/weather"; +import { json } from "@sveltejs/kit"; + +// NOTE: Magnitogorsk, Russian Federation +const WEATHER_LAT = 53.40716; +const WEATHER_LON = 58.980289; + +export async function GET() { + return json( + await fetchWeather(WEATHER_LAT, WEATHER_LON), + { + headers: new Headers({ 'cache-control': 'max-age=600' }), + }, + ); +} \ No newline at end of file