next-on-pages icon indicating copy to clipboard operation
next-on-pages copied to clipboard

[⚡ Feature]: Add support for other methods in the exported worker

Open typeofweb opened this issue 2 years ago • 3 comments

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?

typeofweb avatar Sep 30 '23 18:09 typeofweb

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 😓

dario-piotrowicz avatar Oct 02 '23 17:10 dario-piotrowicz

I've implemented a separate worker for now, thanks!

typeofweb avatar Oct 06 '23 11:10 typeofweb

@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 👍

dario-piotrowicz avatar Oct 06 '23 21:10 dario-piotrowicz