如何用nodeJS搭建一個(gè)bookstores項(xiàng)目的服務(wù)器
我現(xiàn)在啟動(dòng)bookstores是直接在火狐打開的,想知道如何用node來(lái)自己搭建一個(gè)服務(wù)來(lái)啟動(dòng)。
我知道node搭建服務(wù)如下
var http = require('http');
http.createServer(function(req, res){
res.writeHead(200,{'Content-Type':'utf-8'})
res.write('Hello Nodejs?。。。?)
res.end();
})
.listen(2015);
console.log('listenning...');
但是不知道跟bookstores項(xiàng)目一起時(shí)是用法是怎樣的,希望知道的伙伴能指導(dǎo)下,最好有詳細(xì)的過(guò)程,不盡感激??!