NodeJS入門

什麼是NodeJS?

難道我會告訴你百度一下,你就知道?

NodeJS能幹啥?

轉自玉伯

經過 Node,前端程序員能夠搖身一變,變成傳統程序員。數據庫、網絡、業務架構等等技術核心領域,均可以經過 JavaScript 來達成。

NodeJS安裝(win7)

1.下載NodeJshtml

2.在nodeJS的安裝目錄新建一個hello.js,代碼以下:console.log('hello, nodejs.');前端

3.若是你的安裝路徑不是默認路徑,可使用cd\回到根目錄,而後轉到你的安裝路徑,以下:node

4.進入命令控制檯,輸入node hello.js,輸出以下:git

5.在瀏覽器中輸出,在nodeJS安裝目錄新建一個http.js,代碼以下:程序員

var http = require("http");
http.createServer(function(request, response) {
    response.writeHead(200, {"Content-Type": "text/html"});
    response.write("Hello World!");
    response.end();
}).listen(8000);

6.在命令行中輸入:node http.js,而後打開http://localhost:8000/,你就能夠看到hello word!github

官方網站:http://nodejs.org/mongodb

中文官網:http://cnodejs.org/數據庫

node入門:http://www.nodebeginner.org/index-zh-cn.htmlexpress

node api:http://nodejs.org/api/api

expressjs:http://expressjs.com/guide.html http://expressjs.jser.us/api.html(中文資料、api)ejs: https://github.com/visionmedia/ejsmongodb api:http://mongodb.github.com/node-mongodb-native/api-generated/collection.html

相關文章
相關標籤/搜索