tsndr / cloudflare-worker-router

A super lightweight router (1.0K) with middleware support and ZERO dependencies for Cloudflare Workers.
MIT License
227 stars 30 forks source link

Will I get this working with esm workers? #5

Closed simonblund closed 3 years ago

simonblund commented 3 years ago

Hi! Amazing work you have done on these workers projects! If you have some way one could pitch in some like supporter money I would do it in a heartbeat.

I'm trying to get my workers migrated to the new esm syntax and would love to be able to use this router with them, the issue is that they are no longer providing the event, instead a standard request, ctx and env are provided to the fetchhandler.

I will try and create a PR soon if you don't have time to look at this but I will probably just bodge something together and it would not be as elegant as your solutions :smile:

tsndr commented 3 years ago

Hi,

thank you for the kind words, I enabled sponsorship for my projects now if you'd really like to support my work 🙂

I didn't really look into the ESM syntax yet, but it's definitely on my TODO list. I was also planning to rewrite this project and my JWT library in TypeScript.

Since I now know that you're interested in ESM syntax support I'll prioritize it 😁

tsndr commented 3 years ago

The latest release (1.1.6) should help you out :)

simonblund commented 3 years ago

Thank you :D