First glance at node. js and node. js

Source: Internet
Author: User

First glance at node. js and node. js

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.

The V8 engine executes Javascript very quickly and performs very well. Node optimizes some special use cases and provides an alternative API to make V8 run better in a non-browser environment.


Node is a Javascript runtime environment ). In fact, it encapsulates the Google V8 engine. V8 cited worker to execute Javascript very quickly and with very good performance. Node optimizes some special use cases and provides an alternative API to make V8 run better in a non-browser environment.


Install Node. js
The following describes how to install Node. js. First, download the relevant installation package based on the operating system on the Node. js website. For ubuntu [6] (linux) installation, you can do the following:
Sudo apt-get update
Sudo apt-get install node
Or:
Sudo aptitude update
Sudo aptitude install node
Node. js will be added to the sources source list in the sid library.
Sudo echo deb http://ftp.us.debian org/debian/sid main>/etc/apt/sources. list. d/sid. list
Note that after installation, you need to remove/etc/apt/sources. list. d/sid. list.
To install windows, go to nodejs.org and click to download the windows version,
I installed it on the d drive. It is best not to bring the programfile, but it is okay if it is;
Var http = require ("http"); // use an http object to reference the http module http. createServer (// create and accept client requests and return the function (req, res) {res. writeHead (200, {'content-type': 'text/html'}); res. write ('The above is a case


Go to the directory you installed and find an error in compilation. Later, I realized that I had knocked on another {, amount, and the last line was to complete the compilation, finally, you only need to log in to the browser.

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.