使用node.js作为简单的Web服务器
example.comindex.html
index.htmlindex.html
var http = require('http');var fs = require('fs');var index = fs.readFileSync('index.html');http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end(index);}).listen(9615);get
墨色风雨
相关分类