Node. js + Express getting started tutorial _ node. js

Source: Internet
Author: User
The following is a detailed tutorial on Node. js + Express configuration. I think it is quite good. Now I will share it with you and give you a reference. Let's take a look at Node. js as a Javascript runtime ). In fact, it encapsulates the Google V8 engine. V8 cited worker to execute Javascript very quickly and with very good performance. Node. js optimizes some special use cases and provides an alternative API to make V8 run better in a non-browser environment. Node. js is a platform based on Chrome JavaScript runtime. It is used to conveniently build fast and scalable network applications. Node. js uses event-driven, lightweight and efficient non-blocking I/O models, making it ideal for data-intensive real-time applications running on distributed devices.

Express is a simple and flexible web application development framework based on the Node. js platform. It provides a series of powerful features to help you create various Web and mobile device applications. Express is also the officially recommended Web framework.

The following describes how to run a website in the window environment:

1. Install node. js

2. Create a folder nodejs_express

3. Open cmd and go to nodejs_express.

E: \ myapp \ nodejs_express

4. The project initializes npm init. After completing the configuration, a file is generated in the folder:

Package. json

5. install Express: npm install express. After the installation is successful, a node_modules directory is generated in the folder.

6. Express project initialization express (express hello)

7. install the dependency package npm install serve-favicon morgan cookie-parser body-parser path;> npm install jade

Simpler:

Go to the project directory and install the nodejs dependency module npm install (cd hello; npm install)

8. start npm start and use the port 3000 of the local IP address for access.

9. You can modify the port number in the bin/www file.

The above Node. js + Express configuration tutorial details are all the content shared by Alibaba Cloud xiaobian. I hope you can give me a reference and support me more.

Related Article

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.