WebStorm+Node.Js基础配置。
没有前文,只有正文。步骤如下:1、安装WebStorm;参考地址:http://www.jetbrains.com/webstorm/
2、安装Node.Js;参考地址:http://nodejs.org/%20
3、点击下图所示图标
接下来:(这个是配置好的。如果没配置好,狠先下载。直接点就是了)
此时环境就配置好了。接着来写点基本的代码。
/**
* Created with JetBrains WebStorm.
* User: Hstar
* Date: 12-11-18
* Time: 下午10:46
* To change this template use File | Settings | File Templates.
*/
var http=require('http');
http.createServer(function(req,res){
res.writeHead(200,{'Content-Type':'text/plain'});
res.end('Hello World\nThis is my first NodeJs');
}).listen(2222,'127.0.0.1');
console.log("Server running at http:127.0.0.1:2222");
此时,右键如下图所示:
点击运行。此时我们可以打开浏览器,测试刚启动的这段代码。
图示如下:
到此,一个简单的NodeJs开发环境已经搞定。结束了。初学Node,还望多多交流。
页:
[1]