Express quick build project, express build project
Step 1: Install express. See another blog
Step 2: Use the express command to create a project. Command Line input: express-e ejs projectname
Follow the prompts and run the npm install command in the project file. Why should we execute the npm install command? Open package. json and we can find that:
In the package. json file, we have added express4.9.0 to the dependency. The npm install command is used to install various dependencies.
Then, create a project using the ejs template. If it succeeds, open the file directory and you will find the file:
Let's execute this project:
Node app. js
Open the browser and enter: localhost: 3000
OK. An express project has been set up.
Note: If you run node app. js on the terminal and the terminal exits immediately, you need to add the listening port in app. js:
App. listen (3000 );