node.jsmongodbexpressmiddlewareconnect-mongo

Whats the equivalent of express.js "app.use()" in core node.js?


I am trying to use sessions in node.js, for that, i have to use connect-mongo package but in its documentation its been used with express's middleware function app.use() what if I want to use it in a project which does not use any framework like express.js

I have just started using node.js (or any backend) technology, so pardon for any mistakes


Solution

  • By Default Node http does not support middleware. But without express it is possible to do by defining your own chaining. Please refer this answer