So you don’t have to repeat same code over and over again. Node.js is a low-level I/O mechanism which has an HTTP module. If you just use an HTTP module, a lot of work like parsing the payload, cookies, storing sessions (in memory or in Redis), selecting the right route pattern based on regular expressions will have to be re-implemented. With Express.js it there for you to use.

Middleware functions allow you to take action on any incoming request and modify it before sending back a response. Each piece of middleware is just another request handler.

The difference between node.js and express.js is in the level of abstraction:

Node.js is a platform for building server-side event-driven i/o application using javascript.

Express.js is a framework based on node.js for building web-application using principles and approaches of node.js

      To Get Daily Health Newsletter

      We don’t spam! Read our privacy policy for more info.

      Download Mobile Apps
      Follow us on Social Media
      © 2012 - 2025; All rights reserved by authors. Powered by Mediarx International LTD, a subsidiary company of Rx Foundation.
      RxHarun
      Logo
      Register New Account