Javatpoint Logo

91-9990449935

 0120-4256464

Javatpoint Logo

Express.js Scaffolding


What is scaffolding

Scaffolding is a technique that is supported by some MVC frameworks.

It is mainly supported by the following frameworks:

Ruby on Rails,OutSystems Platform, Express Framework, Play framework, Django, MonoRail, Brail, Symfony, Laravel, CodeIgniter, Yii, CakePHP, Phalcon PHP, Model-Glue, PRADO, Grails, Catalyst, Seam Framework, Spring Roo, ASP.NET etc.

Scaffolding facilitates the programmers to specify how the application data may be used. This specification is used by the frameworks with predefined code templates, to generate the final code that the application can use for CRUD operations (create, read, update and delete database entries).


Express.js Scaffold

An Express.js scaffold supports candy and more web projects based on Node.js.


Install scaffold

Execute the following command to install scaffold.

It will take a few seconds and the screen will look like this:

ExpressJs Scaffold 1

After this step, execute the following command to install express generator:

ExpressJs Scaffold 2

Now, you can use express to scaffold a web-app.

Let's take an example:

First create a directory named myapp. Create a file named app.js in the myapp directory having the following code:

Open Node.js command prompt, go to myapp and run npm init command (In my case, I have created myapp folder on desktop)

ExpressJs Scaffold 3

Fill the entries and press enter.

ExpressJs Scaffold 4

It will create a package.json file in myapp folder and the data is shown in JSON format.

ExpressJs Scaffold 5

Output:

ExpressJs Scaffold 6



Latest 4 Tutorials on JavaTpoint