Well, my question is I want to pass some variable from the first middleware to another middleware, and I tried doing this, but there was \"req.somevariable is a
req.somevariable
As mentioned above, res.locals is a good (recommended) way to do this. See here for a quick tutorial on how to do this in Express.