Introduction to the node.js module express.js

My last post covered module loading in node…or at least try to cover the basics in an understandable way… This time, it is time to create something a bit more useful, a proper web application, using a module called “express”. And instead of me talking a whole lot about what I am about to talk about, let’s just get into it…

The first step is to install express. This is done using the NPM as always. The only thing to really decide is whether or not you want to install it globally using the -g parameter, or just locally. Me, I am just going to do it locally, so I use the following command

npm install express

If you install it globally, you can use express to create a “skeleton” application by running the following command

express -s -J <folder name>

This will give you a fullblown express app to start working with. But as I intend to explain the basics, I will start from scratch, and thus just install express to begin with.