1
2
3
4
5
6
7
8
import { fetchJSON } from "https://esm.town/v/stevekrouse/fetchJSON?v=41";
export async function getWeatherByCoords(lat, long) {
const weather = await fetchJSON(
`https://api.open-meteo.com/v1/forecast?latitude=${lat}&longitude=${long}&hourly=temperature_2m,precipitation_probability&forecast_days=1`,
);
return weather;
}