Open Cyberuben opened 5 years ago
Hello @PodaruDragos @Cyberuben did you find the answer ? what is the order in which routes are run in the controller ?
thank you !
hello @andreidiaconescu. I did not actually investigated this issue. I had moved these issues here because I wanted to focus on solving them, but I didn't really had any time on my plate.
inversify-express-utils
does not really do anything to the order, it's just express
under.
I'll reopen this just so it's clear that it's not solved.
I'm just getting into InversifyJS and I'm struggling to get my head around the concept of Express controllers.
Usually I write my code in such a fashion that the routing chain is executed step by step and the context of the request is incrementally stored inside the request object.
routes/index.ts
routes/users/index.ts
routes/users/posts.ts
This way I don't have to validate the user in the controller that manages the posts. How would this be achieved in a sane way using InversifyJS?
Another issue I couldn't find the answer to is the order routes are executed, such
/users/me
being executed before/users/:userId
is evaluated.