mirror of
https://github.com/karl0ss/homepage.git
synced 2025-04-29 12:03:41 +01:00
10 lines
296 B
JavaScript
10 lines
296 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 = `http://api.weatherapi.com/v1/current.json?q=${lat},${lon}&key=${apiKey}`;
|
||
|
|
||
|
res.send(await cachedFetch(api_url, duration));
|
||
|
}
|