Attack on node. JS Foundation (i)

Source: Internet
Author: User
Tags git commands

I. Preface

1:node.js is essentially a JS run environment written in C + + using the Chrome browser V8 engine

2: Compared to JS no browser security restrictions, additional system-level API: File read and write, process management, network communications.

3: There are many projects completed with node. js, such as Appjs cross-platform desktop applications, the jade and node. JS Combination uses a convenient management background HTML template, grunt Automation tools, Express.js

4:nodejs.org,npmjs.com Module Community, Github,stackoverflow

5:gitbash: cmd-like, but can execute GIT commands, highlighted and packaged system commands are better than cmd

Two: examples

1: Official Website example

Const HTTP = require (' http '= ' 127.0.0.1 '=' = ' = ' http.createserver ' (req, res) + = {   = $;  Res.setheader (' content-type ', ' Text/plain ');  Res.end (' Hello world\n '= {  console.log (' Server running at http://  ${hostname}:${port}/');});

A Web server, only need to pass in an anonymous callback function, the server is created successfully, the code is not blocked, but continue to execute, this is the event-driven model of the programming style, in the Nodejs will be a lot of this way, Call this JS file on the command line and start listening.

Attack on node. JS Foundation (i)

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.