Added OpenWeatherMap widget.
This commit is contained in:
1 parent
f0f470ba8b
commit
6a97d392c9
6 files changed
+482
No files matched your search
@@ -0,0 +1,9 @@
|
||||
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));
|
||||
}
|
||||
Reference in new issue
Block a user