Node.js 中的重要API:HTTP

2019-12-16

21:04:14

 

 

 

 

 

require('http').createServer(function (req, res) {
  res.writeHead(200);
  res.end('Hello World');
}).listen(3000);

require('http').createServer(function (req, res) {
  res.writeHead(200,{'Content-Type':'text/html'});
  res.end('Hello <b>World</b>');
}).listen(3000);

 

 

 

 

 

猜你喜欢

转载自www.cnblogs.com/JasonPeng1/p/12052477.html