Node. js Lesson 2 (Getting Started)

Source: Internet
Author: User

Prepare Example 1. input console. log ('Hello World') in a text editor and save it as helloworld. js. Open the dos window and enter the directory of the file to run node helloworld. js execution shows the output helloworld2.Node. js command line tool node-v version node-e eval scjit eval ("console. log ('hha '); for example: node-e "console. log ('Hello World') "; execute node directly to enter the compiling mode console. the first line of log ("111") is the output, and the second line is the return value. create an HTTP server to create an app. js var http = require ('http') http. createServer (function (req, res) {res. writeHead (200, {'content-type': 'text/html'}); res. write ('

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.