Working with Express.JS

This is an intro to a collection of brief tutorials about Express.JS and its basic routing & rendering functionalities. This is aimed towards newbies (like myself), and to those who are wondering what Express.JS is all about and its capabilities. Let’s start with a brief explanation of WHAT Express.JS is.

WHAT is Express.JS ?

Express.JS is a Node.JS framework packed with a ton of helpful features like URL routing and rendering. But I believe one of the best features of Express.JS is that it allows you to organize your web application in an MVC architecture.

WHY use Express.JS?

Because its a simple and fast way of building your own web application! Not only that its FULL of features and beginner friendly its also built using Node.JS.

For more information please ask my good friend Google.

Now that we got that out of the way let’s start with some basic setup.

Setting up with CLOUD 9 ( IT’S FREE)

To have a consistent experience across all platforms let’s setup Express.JS using CLOUD9. Think of Cloud9 as a virtual machine that comes with its own code editor and bash terminal. This will eliminate all the tedious setups, installations, and complexity that comes with setting up Express.JS on your own local machine, and oh it’s also for FREE.

Go ahead and click on the Cloud9 link above and sign up. Create your own workspace, and choose Node.JS as the template. Once it boots up, you should have an empty workspace with some starter files which you can go ahead and delete. Your workspace should look like this:

Cloud9 Workspace

Once you have settled in Cloud9 let’s go ahead and create a directory called “firstapp”. Let’s cd into the firstapp folder and in the terminal, let’s type “npm install express”. This will install express itself and all the dependencies that come with it. Your workspace should look something like this:

Bam! You have installed Express with ease using CLOUD9, told you it was going to be easy! Go ahead and relax, you deserve it. In the next part I will walk you through starting your own local server and creating your very first express route.

Thanks for reading!