var http = require('http');
var fs = require('fs');
var html = fs.readFileSync('./index.html');
http.createServer(function (req, res) {
if (req.method == 'POST') {
req.pipe(process.stdout);
res.writeHead(200, {'Content-Type': 'text/plain'});
req.pipe(res);
}
else {
res.writeHead(200, {'Content-Type': 'text/html'});
res.end(html);`enter code here`
}
}).listen(8080);
質問する
407 次