- Express generator is used to scaffold out an Express application. Thereafter you will modify the application to support REST API making use of the Node modules.
- Generating an Express application using the express-generator
- Modify the Express application to support the REST API by adding routes
- Install express-generator by typing the following at the prompt:
npm install express-generator -g
- Use sudo if you are using an OSX or Linux machine.
- Scaffolding an Express Application
- To scaffold out an Express application, type the following at the prompt:
express node-express-gen
Next, move to the node-express-gen folder. Type the following at the command prompt to install all the Node modules
npm install
You can start the Express server by typing the following at the prompt:
npm start