mirror of
https://github.com/karl0ss/homepage.git
synced 2025-05-11 09:18:12 +01:00
10 lines
310 B
JavaScript
10 lines
310 B
JavaScript
![]() |
import cachedFetch from "utils/cached-fetch";
|
||
|
|
||
|
export default async function handler(req, res) {
|
||
|
const { lat, lon, apiKey, duration } = req.query;
|
||
|
|
||
|
const api_url = `https://api.openweathermap.org/data/2.5/weather?lat=${lat}&lon=${lon}&appid=${apiKey}`;
|
||
|
|
||
|
res.send(await cachedFetch(api_url, duration));
|
||
|
}
|