I want to split up my routes into different files, where one file contains all routes and the other one the corresponding actions. I currently have a solution to achieve thi
Or just do that:
var app = req.app
inside the Middleware you are using for these routes. Like that:
router.use( (req,res,next) => { app = req.app; next(); });