Merge pull request #25 from AlexFullmoon/main

Added OpenWeatherMap widget.
This commit is contained in:
Ben Phelps authored and GitHub committed 2022-08-27 15:13:27 +03:00
commit dc6b172df9
6 files changed
+479

No files matched your search

+9
View File
@@ -0,0 +1,9 @@
import cachedFetch from "utils/cached-fetch";
export default async function handler(req, res) {
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}&units=${units}`;
res.send(await cachedFetch(api_url, duration));
}