Torby
Torby
CDCloudflare Developers
Created by Torby on 3/15/2024 in #general-help
Cannot get worker to trigger with route on site
Here's my worker code:
// Export a default object containing event handlers
export default {
// The fetch handler is invoked when this worker receives a HTTP(S) request
// and should return a Response (optionally wrapped in a Promise)
async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
console.log('Got a request:', request.url);
return fetch(request);
},
};
// Export a default object containing event handlers
export default {
// The fetch handler is invoked when this worker receives a HTTP(S) request
// and should return a Response (optionally wrapped in a Promise)
async fetch(request: Request, env: Env, ctx: ExecutionContext): Promise<Response> {
console.log('Got a request:', request.url);
return fetch(request);
},
};
4 replies