inversify-express-example icon indicating copy to clipboard operation
inversify-express-example copied to clipboard

Middleware after controller

Open vitorfreitas opened this issue 6 years ago • 1 comments

Context

How can I chain a middleware to be called after the controller function? I'm writing a middleware that automatically reads the response object and set the correct http status code. What I want to do is just like this example using regular express.js

router.get('/route', middleware1, controllerFn, middleware2)

Your Environment

  • Version used: inversify: ^5.0.1 | inversify-express-utils: ^6.3.2
  • Environment name and version: node 10.15.3
  • Operating System and version (desktop or mobile): Linux popOS 5.3.0-7629-generic

vitorfreitas avatar Feb 21 '20 19:02 vitorfreitas

+1

ttruongatl avatar Jan 08 '22 15:01 ttruongatl