mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-13 16:30:31 +00:00
Cleaned up some OpenWeatherMap logic.
This commit is contained in:
parent
6a97d392c9
commit
2faa78163a
2 changed files with 5 additions and 8 deletions
|
@ -1,9 +1,9 @@
|
|||
import cachedFetch from "utils/cached-fetch";
|
||||
|
||||
export default async function handler(req, res) {
|
||||
const { lat, lon, apiKey, duration } = req.query;
|
||||
const { lat, lon, apiKey, duration, units } = req.query;
|
||||
|
||||
const api_url = `https://api.openweathermap.org/data/2.5/weather?lat=${lat}&lon=${lon}&appid=${apiKey}`;
|
||||
const api_url = `https://api.openweathermap.org/data/2.5/weather?lat=${lat}&lon=${lon}&appid=${apiKey}&units=${units}`;
|
||||
|
||||
res.send(await cachedFetch(api_url, duration));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue