express-generator : Scaffolding Of Express Application

In the last article, we have created the “Express” application and exposed REST services. There is a node module called “express-generator” which will provide scaffolding of node express application. Follow the below steps to create an express application using “express-generator”.

Step 1: Install “express-generator” node module globally.

npm install express-generator -g

Step 2: Go to command prompt and create the express application.

D:\>express sample-express-app

After the application creation, you will see the folder structure as shown below.

Step 3: Now, go to the application folder which we created in the above step and perform npm install. This will install all the node module dependencies.

D:\>cd sample-express-app
D:\sample-express-app>npm install

Step 4: Its time to start the node application by running npm start command. By default, the server will run on 3000 port.

That’s it. The express application is ready. In the coming article, we will see some of the node modules which I have used.