Step1.至官網下載node.js
因為要使用windows環境下測試,所以下載node-v0.65.msi
Step2.下載完畢直接點擊安裝
- win7平台,預設會安裝在C:\Program Files (x86)\nodejs。
Step3.撰寫運行範本example.js
- 該範例存在C:\nodeJS_UT\example.js
var http = require('http');
http.createServer
(
function (req, res)
{
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello Node.js\n');
}
).listen(6101, "127.0.0.1");
console.log('Server running at http://127.0.0.1:6101/');
- 6101是ProtNumber,請自行調整。
參考資料:
http://nodejs.org/
http://www.cnblogs.com/ciznx/articles/run-nodejs-within-iis-on-windows.html
將node.js與IIS結合的參考:
http://tomasz.janczuk.org/2011/08/hosting-nodejs-applications-in-iis-on.html
http://www.hanselman.com/blog/InstallingAndRunningNodejsApplicationsWithinIISOnWindowsAreYouMad.aspx
http://cnodejs.org/blog/?p=2610
http://www.cnblogs.com/ciznx/articles/run-nodejs-within-iis-on-windows.html
Apache與node.js
http://arguments.callee.info/2010/04/20/running-apache-and-node-js-together/
沒有留言:
張貼留言