NodeJs Start Chapter

Source: Internet
Author: User

Introduction to node. js

The Wikipedia introduction to node. js Http://baike.baidu.com/view/3974030.htm?fromtitle=nodejs&type=syn

node. JS Installation

This is the website of node. JS http://www.nodejs.org

The author's operating system is Win7 64bit. Direct selection of an installable MSI file for download and installation

Once the installation is complete, set the environment variable so that we can access the node program directly in command line mode.

The first program of node. js

Create a test.js file on the desktop, edit it, and the code is as follows:

var http = require (' http '); Http.createserver (function (req, res) {    res.writehead (200,{' content-type ': ' text/html ') });    Res.write (' 

Then open the command line terminal, the following way to run this JS file

Finally, open the browser, enter 127.0.0.1:8080 in the Address bar, the following page appears

OK, it's a success. Simple, huh?!

here is [email protected], welcome to Exchange.

I original works, reproduced please indicate the source.

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.