hello nodejs
生活随笔
收集整理的這篇文章主要介紹了
hello nodejs
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
文章1一步:下載、安裝文件
??? 打開nodejs官方網站http://www.nodejs.org/download/ 。選擇須要的版本號。直接打開。默認安裝就可以
第二步:編寫測試代碼:
var http = require('http'); http.createServer(function(req, res) {res.writeHead(200, {'Content-Type': 'text/plain'});res.end('Hello World\n'); }).listen(1337, "127.0.0.1"); console.log('Server running at http://127.0.0.1:1337/');第三步:執行測試程序
進入到node的安裝文件夾運行
node hello.js看到控制臺有以下輸出即成功:Server running at http://127.0.0.1:1337/
參考:http://www.cnblogs.com/beiyuu/archive/2011/07/29/install-nodejs.html
??????????? http://blog.csdn.net/freshlover/article/details/12691031
?????????? http://cnodejs.org/topic/4fae80c02e8fb5bc650a8360
版權聲明:本文博主原創文章,博客,未經同意不得轉載。
轉載于:https://www.cnblogs.com/bhlsheji/p/4868768.html
總結
以上是生活随笔為你收集整理的hello nodejs的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 最新华为悦盒V9_V9U_V9E_V9A
- 下一篇: huya虎牙小程序------真心话大冒