Something to consider is that the express
module exposes some other functionality that you might want to make use of later (e.g. express.static
). In your case you would have to require
express again to gain access to it:
app.use(require('express').static());
Other than that there is no reason it's "bad practise". It just depends on what you intend to leverage from the module.