Node. js express installation and example website construction (Sharing), node. jsexpress
1. You must first install Node. JS
Run the following commands in windows cmd:
Cd C: \ Program Files \ nodejs \
Npm install-g express
Npm install-g express-generator
2. Create a sample project
Run the following commands in windows cmd:
Cd C: \ Program Files \ nodejs \ node_global
Express-e microblog // ejs,-j (jade)
Cd microblog
Npm install
3. Modify the HTTP server js File
Modify the app. js file, except module. exports = app;, and add app. listen (3000 );
4. Enable Service Listening:
Enter the following content in the cmd command:
Cd C: \ Program Files \ nodejs \ node_global \ microblog
Node app. js
5. Enter
Http: // 127.0.0.1: 3000
The interface is shown as follows:
So far, a sample Website is successfully built.
The above node. js express installation and example website construction method (SHARE) is all the content shared by Alibaba Cloud xiaobian. I hope you can give us a reference and support for the customer's house.