1. First of all, you must install Node.JS
Enter the following commands in Windows cmd in sequence:
cd C:/Program Files/nodejs/
npm install -g express
npm install -g express-generator
2. Create a sample project
Enter the following commands in Windows cmd in sequence:
cd C:/Program Files/nodejs/node_global
express -e microblog //i.e. ejs, -j (i.e. jade)
cd microblog
npm install
3. Modify the HTTP server js file
Modify the app.js file, remove module.exports = app;, and add app.listen(3000);
4 Turn on service monitoring:
Enter the following content under the cmd command:
cd C:/Program Files/nodejs/node_global/microblog
node app.js
5. Enter in the browser
http://127.0.0.1:3000
The interface is displayed as follows:
At this point, a sample website was successfully built
The above article on node.js express installation and sample website construction methods (sharing) is all the content I share with you. I hope you can give you a reference and I hope you can support Wulin.com more.