惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - 【当耐特】
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Y
Y Combinator Blog
D
DataBreaches.Net
Google DeepMind News
Google DeepMind News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
云风的 BLOG
云风的 BLOG
Recorded Future
Recorded Future
I
InfoQ
L
LangChain Blog
Stack Overflow Blog
Stack Overflow Blog
Recent Announcements
Recent Announcements
宝玉的分享
宝玉的分享
Martin Fowler
Martin Fowler
J
Java Code Geeks
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
A
About on SuperTechFans
人人都是产品经理
人人都是产品经理
G
Google Developers Blog
大猫的无限游戏
大猫的无限游戏
C
Cybersecurity and Infrastructure Security Agency CISA
Know Your Adversary
Know Your Adversary
MongoDB | Blog
MongoDB | Blog
T
Tor Project blog
The Register - Security
The Register - Security
H
Help Net Security
Cisco Talos Blog
Cisco Talos Blog
P
Privacy & Cybersecurity Law Blog
NISL@THU
NISL@THU
P
Palo Alto Networks Blog
B
Blog RSS Feed
Latest news
Latest news
T
Threat Research - Cisco Blogs
The Hacker News
The Hacker News
C
Cisco Blogs
P
Privacy International News Feed
T
The Exploit Database - CXSecurity.com
V
Vulnerabilities – Threatpost
S
Schneier on Security
P
Proofpoint News Feed
Schneier on Security
Schneier on Security
www.infosecurity-magazine.com
www.infosecurity-magazine.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
AI
AI
Google Online Security Blog
Google Online Security Blog
H
Hacker News: Front Page
N
News and Events Feed by Topic
W
WeLiveSecurity

博客园 - chenping2008

连接远程数据库,得到数据插入本地表中 php复制目录 PHP删除目录 php统计目录大小 js秒数转换天时分秒 JS切换图片 js 游览器log的记录 2个iframe中checkbox联动 JS Clone函数 JS普通递归的改进 JS随机数的产生方法 JS相等运算符(==)和等同运算符(===) silverlight树形结构区服选择 Mongodb的一些基本概念 Mongodb在Ubuntu下的安装 redis windows下使用及redis命令 相册功能 Node.js 系列翻译---console 补充Silverlight中图片显示
Node.js 系列翻译---概要
chenping2008 · 2011-11-14 · via 博客园 - chenping2008

1. Node.js

Node让你可以用javascript编写服务器端程序,让javascript脱离web浏览器的限制,像C#、JAVA、Python等语言一样在服务器端运行,这也让一些熟悉Javascript的前端开发人员进军到服务器端开发提供了一个便利的途径。 Node是基于Google的V8引擎封装的,并提供了一些编写服务器程序的常用接口,例如文件流的处理。Node的目的是提供一种简单的途径来编写高性能的网络程序。 

2. Node.js install

    Node.js下载地址: http://nodejs.org/    和  http://nodejs.org/#download   选择windows install下载直接安装就可以。(其他系统平台下的安装可以网上找资料)

3.摘要

用node的一个在web server 输入"Hello World"的示例:

3.1在D盘下新建一个JS文件,文件名为:Server.js,JS文件中的代码如下:

var http=require('http');

http.createServer(function(require,response){
    response.writeHead(200,{'Content-Type':'text/plain'});
    response.end('Hello World\n');
}).listen(8124);

console.log('Server running at http://127.0.0.1:8124/'); 

这些JS代码可以用任何的编辑工具进行编写,nodepat++   记事本 等等。 

3.2 然后点击电脑 开始->运行->cmd,然后输入node D:\Server.js 可以看到:Server running at http://127.0.0.1:8124/

3.3 开启游览器,输入地址:http://127.0.0.1:8124/ 可以看到游览器中显示内容"Hello World"

到此,一个简单的node.js示例就OK了。 

原文地址: http://nodejs.org/docs/v0.6.1/api/synopsis.html