I want to move a series of app.use()
calls into its own module. The easiest way to encapsulate this is to expose a function(app)
in the exports, but I feel that handing over the app
object is too much of an opaque interface.
I would like to expose a middleware to be app.use()
'd from outside the module. I need to chain/compose the middlewares used internally.
Is there a stylish way of doing this, or an alternative? What's the easiest way of going about it? Anything I should avoid?