colyseus / uWebSockets-express

Express API compatibility layer for uWebSockets.js
https://npmjs.com/package/uwebsockets-express
MIT License
56 stars 13 forks source link

Express router middleware/route order issue #8

Closed ryanwillis closed 2 years ago

ryanwillis commented 3 years ago

Hi there, thanks for the great package!

I noticed that when passing an express router to use, the order of middleware and routes are not preserved. Middleware are always executed before routes even when defined afterwards.

To Reproduce: Hit reload in the browser pane of each of these examples and check the console.

uWebSockets-express middleware order: https://codesandbox.io/s/uwebsockets-express-middleware-order-issue-jcw6z

Express router middleware order: https://codesandbox.io/s/express-router-as-middleware-ordering-7rxgv

endel commented 3 years ago

Thanks for the reproduction scenario! Gonna take a look soon!

ryanwillis commented 3 years ago

Any luck with this?