Execute middleware on every route call

Solution 1:

In express.ts file, you can add a middleware that would do it before mounding the Router, and then just procced forward with next(). You can do it like this:

App.use('/*', (req, res, next) => {
  service.setParameter(req);
  next();
});

App.use('/', Router)