Express js Scaffolding

Scaffolding is used to create a skeleton structure for our application. This is supported by many MVC frameworks. This reduces lots of development cost, as it has predefined templates that we can use for CRUD operations.

Install express-scaffold

There are many express.js scaffolding available, here we are using 'express-scaffold'. This is a simple mvc scaffolding of express. To install this, create a directory and run the following command from that directory.

$ npm install express-scaffold

Express Generator

This package contains an express command line tool, run the following command to install express-generator package.

$ npm install express-generator -g
Express.js Generator

This is the lists of express generator command options. Suppose we want to use a pug view engine to create new applications.

Express.js Generator

Then, also commands these following-

>cd newapp
>npm install
>SET DEBUG=newapp:* & npm start
Express.js Generator

Open the browser at the following url 'http://localhost:3000/', we will get this -

Express.js Generator

Read more articles

General Knowledge

Learn Popular Language