Search This Blog

August 9, 2014

Express 3.x - Web-app framework without Web-server

This image is not the logo of ExpressJS
Looks like with Express 3.x the code is more modularised. Express framework is now a web framework devoid of web server functionality.

For the sake for simplicity and clarity by comparison, check the code pre and post Express 3.x version, all by yourself. I believe the code is self-explanatory.

And I should say, I like Express 3.x this way - loose coupling.

Express web-framework before version 3.x

Express web-framework in version 3.x

In the same fashion, EmbeddedJS (or EJS) which was once built into Express is no longer part of it. The advantage? Modular. Less footprint. If YAGNI, then why have it? Plug and play your choice of templating engine -- EJS, or Jade or Mustache or Handlebar -- by installing it as dependency.

Update: Beginning Express 4.x, the express-generator is separated from the core express framework. What does that mean to you?
* You'll need to install express locally for every project.
          $ npm install express                                       
* You'll need to install express-generator command-line executable globally
          $ sudo npm install -g express-generator