Scaffolding is the process of creating the skeleton of the project. In simple terms, the arrangement of different types of files in various folders. For example, managing all the CSS files, js files that we want to be public, in the public folder, different routes in the routes folder, and images in a separate folder.
Scaffolder is the tool used to automate this task. A popular scaffolder for Express Js is an express-generator.
To use the express-generator, run the following command :
Folder Structure
- Routes: This folder contains various routes of the application, divided in different files.
- Public: This folder contains the files we want to be public like images and CSS files.
- Views: Views folder contains different templating files that we want to serve.
- app.js: This is the place where all the code is managed. It handles all the other files.