2

In the documentation for Inversify Express Utils, the example shows how to override BaseMiddleware and then to inject it into a particular route in a controller as shown here.

Is there a way to inject the middleware into every route without specifically including it in each @httpX decorator?

honk
  • 9,137
  • 11
  • 75
  • 83
Evan Kaiser
  • 181
  • 8
  • 1
    What have you tryed at this point? – Mathieu de Lorimier Feb 09 '18 at 14:18
  • 1
    @MathieudeLorimier Here's an example: https://github.com/kaiserapps/hacda-money-api/blob/master/src/api/controllers/foo.controller.ts. As you can see, I had to add the `Types.LoggingMiddleware` to all the routes in the controller. Just wondering if there's a way to say to use it globally for all routes (or at least once per controller). – Evan Kaiser Feb 10 '18 at 23:14

0 Answers0