Nodejs Getting Started

Source: Internet
Author: User
Tags install node

I want to say something about configuring node. js in a Windows environment ... First step: Download the installation file : Official website http://www.nodejs.org/,Select the appropriate installation package according to your computer's configuration. Step Two: Install node. jsAfter the download is complete, double-click the image file to follow the next step, the next boot, the middle can change the installation path, the final installation successful interface is: After successful installation, in "Command Prompt" input: Node-v view the installation version, the output version is installed successfully Step Two: Test the installed node. JSCreate a new folder in the D drive Nodepro inside a new file hello.js, inside a line of code

Go to the command line console, go to the new folder in front of you, and enter note hello.js

Results of the output

The console outputs "Hello, Nodejs."

Iv. Web version of HelloWorld
Create a new http.js in the above directory with the following code

var http = require ("http"); Http.createserver (function(request, Response) { Response.writehead ($, {"Content-type": "Text/html"}); Response.Write ("Hello world!" ); Response.End ();}). Listen (

Start the service on the command line and tap node Http.js

Then open the browser address bar input http://localhost:8000/, see the page output Hello world! It was a success.

Congratulations on starting the World of node. js.

Home: http://nodejs.org/

English api:http://nodejs.org/api/(latest)

Chinese api:http://nodeapi.ucdok.com/#/api/

Nodejs 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.