Node. js express installation and example website construction (Sharing), node. jsexpress

Source: Internet
Author: User
Tags install node

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.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.