这是我的代码
var http = require('http');
var hostname = 'localhost';
var port = 3000;
var server = http.createServer(function (req,res) {
console.log(req.headers);
res.writeHead(200,{'content-type':'text/html'});
res.end('<h1>This is hello word</h1>');
});
server.listen(port,hostname,function () {
console.log(`server running at http://${hostname}:${port}/`);
});