var http = require('http');
var fs = require('fs')
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
fs.readFile('test.json', function(err, data){
if (err){
console.log(err)
}else{
console.log(data.toString());
res.write(data)
res.end();
}
})
}).listen(8080);
這樣?