We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1a9e1a2 commit 3da16f5Copy full SHA for 3da16f5
samples/geolocation-weather/src/index.ts
@@ -14,7 +14,11 @@ router
14
15
//@ts-ignore
16
addEventListener('fetch', async (event: FetchEvent) => {
17
- event.respondWith(router.fetch(event.request));
+ let token = Variables.get("waqi_api_token");
18
+ if (!token) {
19
+ event.respondWith(new Response("Internal Server Error", {status: 500});
20
+ }
21
+ event.respondWith(router.fetch(event.request, {token}));
22
});
23
24
async function getWeather(request: Request): Promise<Response> {
0 commit comments