unjs / nitro

Next Generation Server Toolkit. Create web servers with everything you need and deploy them wherever you prefer.
https://nitro.unjs.io
MIT License
5.89k stars 496 forks source link

Support route rules per HTTP verb #2668

Open Barbapapazes opened 1 month ago

Barbapapazes commented 1 month ago

Describe the feature

Hello,

Actually, a route rule apply to a pattern but having it per http verb could be useful, especially for rate limiting.

Imagine the route GET /me, I do not need to rate limit it but the route PATCH /me will send an email to the user so I need to rate limit it.

Additional information

pi0 commented 1 month ago

coming in nitro v3 (since new rou3 library used for route rule matching natively supports verbs. radix3 in v2 cannot)