1
如何獲取字符串路徑名?如何獲取字符串路徑名?
var http=require('http');
var url = require("url");
http.createServer(function(req,res){
var pathname = url.parse(req.url).pathname;
console.log("Request for " + pathname + " received.");
res.writeHead(200,{'Content-Type':'text/plain'});
res.end('Hello\n');
}).listen(8124,'127.0.0.1');
console.log('Server me!');
沒有錯誤輸出,但不顯示請求....
看到這篇文章的日誌:http://stackoverflow.com/questions/3459476/how-to-append-to-a-file-in-node –