不废话了!直接上代码:

     1    var http = require('http'); //导入模块http
     2    http.createServer(function(request,response){
     3        response.writeHeader(200,{'Content-Type':'Text/Plain','name':'tom',}); //用来定义响应头部
     4        response.end('Hello World!\n'); //用来定义响应主体
     5    }).listen(8888); //监听端口
     6    console.log('mServer is running at http://127.0.0.1:8888...'); //服务器程序的提示信息

 

相关文章:

  • 2022-03-02
  • 2021-08-12
  • 2021-12-05
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-08
  • 2022-12-23
猜你喜欢
  • 2021-11-23
  • 2021-12-17
  • 2022-12-23
  • 2021-12-27
  • 2021-12-19
  • 2021-07-07
  • 2021-10-09
相关资源
相似解决方案