moleculerjs / moleculer-web

:earth_africa: Official API Gateway service for Moleculer framework
http://moleculer.services/docs/moleculer-web.html
MIT License
292 stars 118 forks source link

Cannot skip route with middleware #334

Open srosset81 opened 9 months ago

srosset81 commented 9 months ago

Hello,

On the index.d.ts file, it is noted we should be able to call Express-style next('route') in a middleware to skip to another route:

https://github.com/moleculerjs/moleculer-web/blob/29637c17011d0535f1d8b139a9f130eb5f37a736/index.d.ts#L393-L405

But when I do that, an error is simply thrown with "route" as the message (Request error! MoleculerError : route).

Would it be possibly to add this option ?

Many thanks

srosset81 commented 9 months ago

Finally I find it easier to handle my problem by changing routes priorization. See the other issue I opened: https://github.com/moleculerjs/moleculer-web/issues/335

However I keep this issue open because, if next("route") is not handled, it should not appear on the index.d.ts file.