NodeJs Express 4.x Getting Started

Source: Internet
Author: User
Tags generator generator node server

Introduction: In the Express framework from 3.x to 4.x, a large change, the main thing is to replace the middle of the library connect, instead of using more granular libraries instead. The benefit of this approach is that these middleware can be updated and released more freely, without being affected by the express release cycle. The problem with this, however, is that 4.x is not fully compatible with the previous 3.x version. Therefore, write a document to record the introductory document for Express 4.x.

Environment: Install Nodejs and NPM First, the process will not repeat.

Installation:

1. Express:

<1> Global Installation: NPM INSTALL-G Express (recommended)

<2> Local Installation: NPM install express-d

After the installation is complete, you can use: Express-v view version number

2. Express-generator:

<1> Global Installation: NPM install-g express-generator

<2> Local Installation: NPM install express-generator-d

3. Create a simple project instance using the Express-generator generator:

EXPRESS-E Framework

4. Install the basic middleware

CD Framework && NPM Install

5. Start

NPM start

6. Through http://server_ip:3000, the following pages are visible (Server_ip is the physical machine IP address where the node server resides)

At this point, the webserver of a simple Nodejs express framework is built.

NodeJs Express 4.x Getting Started

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.