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

推荐订阅源

Forbes - Security
Forbes - Security
T
Tailwind CSS Blog
Hugging Face - Blog
Hugging Face - Blog
Blog — PlanetScale
Blog — PlanetScale
WordPress大学
WordPress大学
aimingoo的专栏
aimingoo的专栏
Y
Y Combinator Blog
U
Unit 42
I
InfoQ
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
V
Visual Studio Blog
B
Blog RSS Feed
Vercel News
Vercel News
F
Fortinet All Blogs
Know Your Adversary
Know Your Adversary
T
Troy Hunt's Blog
博客园 - 【当耐特】
MongoDB | Blog
MongoDB | Blog
大猫的无限游戏
大猫的无限游戏
A
About on SuperTechFans
Jina AI
Jina AI
小众软件
小众软件
T
Threatpost
有赞技术团队
有赞技术团队
人人都是产品经理
人人都是产品经理
The Hacker News
The Hacker News
T
The Exploit Database - CXSecurity.com
C
CXSECURITY Database RSS Feed - CXSecurity.com
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Microsoft Azure Blog
Microsoft Azure Blog
Recent Announcements
Recent Announcements
酷 壳 – CoolShell
酷 壳 – CoolShell
Scott Helme
Scott Helme
B
Blog
腾讯CDC
Last Week in AI
Last Week in AI
P
Proofpoint News Feed
S
Schneier on Security
N
News and Events Feed by Topic
Microsoft Security Blog
Microsoft Security Blog
K
Kaspersky official blog
G
Google Developers Blog
T
Tor Project blog
PCI Perspectives
PCI Perspectives
S
Secure Thoughts
Google Online Security Blog
Google Online Security Blog
Latest news
Latest news
Google DeepMind News
Google DeepMind News
MyScale Blog
MyScale Blog
罗磊的独立博客

博客园 - 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