CleverPatrick
CDCloudflare Developers
•Created by CleverPatrick on 4/14/2025 in #workers-help
Trying to add a cron job to my worker.
I have an existing worker that uses Hono to expose some API endpoints:
I am trying to add a cron job to this worker but I am continuously getting either a
"Handler does not export a scheduled() function" error or a,
"worker.fetch is not a function" error.
I am defining my scheduled.ts worker like this:
and then updating my main index.ts export like this:
But at runtime I am getting the error:
Error: Handler does not export a fetch() function.
3 replies
CDCloudflare Developers
•Created by CleverPatrick on 3/17/2025 in #workers-help
Multiple workers at the same domain, but multiple paths in wrangler.jsonc
I am trying to setup multiple workers at
api.mydomain.com
with different paths, but am not sure how to configure the routes section in wrangler.jsonc
I want my worker’s APIs to be available at api.mydomain.com/worker. But if I set that in the routes array in wrangler.jsonc like this:
It doesn’t work because there is no DNS record set up for api.mydomain.com.
If I define a custom domain as part of the routes like this:
My API becomes available at api.mydomain.com
, which is not what I want. Also, api.mydomain.com/worker1
routes never work, no matter what variations I try.
Can anyone tell me what configuration I need to set to make my API available at a specific path of api.mydomain.com
?3 replies