Simple Nodejs – Express Webpage

                                                                                                                         
 

Simple guide to getting up and running with NODE.JS, EXPRESS and JADE

Download code here for free.

  1. Install Node.js

Click on website : https://nodejs.org/en/ and get latest nodejs installed in your system.

 

  1. Install Express Generator

To install express-generator we will use “npm install” command in command prompt

D:\projs> npm install -g express-generator

 

  1. Create an express project

To create an express project, we will use command “express” in command prompt. Below is the output:

  1. package.json file

Package.json file is installed during creation of express project. We can open this file in editor. File will be as shown in below pic :

Package json file format

This is a simple JSON file having description about our app and list of dependencies.

  1. Install dependencies by “npm install”

We should install dependencies mentioned in package.json, by running npm install in the example1 folder.  Running npm install will create new folder “node_modules” inside example1 folder

D:\projs\example1>npm install

  1. Start webserver

We can test our webserver by first running command “npm start” in the command prompt :.
D:\projs\example1>npm start
> example1@0.0.0 start D:\projs\example1
> node ./bin/www

and then by browsing to url localhost:3000. We will be seeing below page:

Express default Page

Download code here for free.

 
                                                                                                                         
 

2 thoughts on “Simple Nodejs – Express Webpage”

  1. Hi there, simply turned into aware of your weblog via Google, and found that it’s really informative. I am gonna be careful for brussels. I will be grateful should you proceed this in future. Numerous other people will probably be benefited from your writing. Cheers!
    cotyml

Leave a Reply

Your email address will not be published. Required fields are marked *