2
3export default async function main(req: Request): Promise<Response> {
4 const response = await fetch("https://www.metaweather.com/api/location/2459115/");
5 const weatherData = await response.json();
6
2
3export default async function main(req: Request): Promise<Response> {
4 const response = await fetch("https://www.metaweather.com/api/location/2459115/");
5 const weatherData = await response.json();
6
1// This val fetches weather data from an open API
2// The approach involves using the fetch API provided by Deno
3// to retrieve weather information for a specific location
4
6 const apiUrl = "https://api.open-meteo.com/v1/forecast?latitude=40.6782&longitude=-73.9442&hourly=temperature_2m¤t_weather=true";
7
8 const response = await fetch(apiUrl);
9 const weatherData = await response.json();
10
176});
177
178export default app.fetch;
179
181});
182
183export default app.fetch;
184
213});
214
215export default app.fetch;
216
232});
233
234export default app.fetch;
235
184});
185
186export default app.fetch;
187
188});
189
190export default app.fetch;
191
193});
194
195export default app.fetch;
196
197