您的位置:首页 > Web前端 > Node.js

NodeJS dev environment configure

2013-11-28 12:01 435 查看
简述:

记录NodeJS Eclipse开发环境配置

步骤:

1. 本地安装Nodejs的exe

http://nodejs.org/dist/v0.10.22/node-v0.10.22-x86.msi

安装完成之后进入command



2. 进入Eclipse Marketplace

安装(参考:http://www.yl-blog.com/index.php/js/95.html



此外下载一个javascript 的插件VJET

http://download.eclipse.org/vjet/updates-0.10

一款调试工具 google调试工具

http://chromedevtools.googlecode.com/svn/update/dev/

2. 下载之后新建一个项目



3. 工程创建完成



4. cmd进入项目路径

输入:

node hello-world-server.js



5. 代码

var http1 = require('http');
http1.createServer(function handler(req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Welcome !\n');
}).listen(10723, '192.168.2.191');
console.log('Server running at http://192.168.2.191:10723/'); 
var http2 = require('http');
http1.createServer(function handler(req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Welcome !\n');
}).listen(10724, 'localhost');
console.log('Server running at http://localhost:10724/');


6. 页面访问:



内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: