[⚡ Feature]: Add support for other methods in the exported worker
Description
Currently, the worker template only implements the fetch method.
Would it be possible to add other methods as well?
-
tail -
trace -
scheduled -
test -
email -
queue
Additional Information
No response
Would you like to help?
- [X] Would you like to help implement this feature?
Thanks a lot for the issue @mmiszy, unfortunately the methods you shared are only currently available on Workers, and not Pages, so it is not something that we can add to next-on-pages (since we do create a Worker but that is used in a Pages application, it is not deployed as a simple Worker)
We'll definitely look into implementing those methods when/if it will be possible to do so (especially the scheduled one as we'd need it to match the Vercel one) but currently there isn't really a way to implement them sorry 😢
The only viable alternative is I believe to create separate workers which do implement such methods and from them you can then send requests to your next-on-pages application, sorry to disappoint you 😓
I've implemented a separate worker for now, thanks!
@mmiszy yeah that's the way to go for now, hopefully it's not too inconvenient for your use case 🙂
I've marked the issue as blocked by external as we might likely be able to support the other methods/triggers at some point so we might keep this issue around as a reminder 👍