美文网首页
Node.js 创建服务器

Node.js 创建服务器

作者: pokeey | 来源:发表于2018-07-16 17:26 被阅读0次
"use strict";

const http = require('http');

var server = http.createServer();

server.on('request',(request,response) => {
  response.writeHead(200, {
    'Content-Type':'Text/Html'
  });
  response.end(`<h1>hola</h1>`);
});

server.listen(8080);

相关文章

网友评论

      本文标题:Node.js 创建服务器

      本文链接:https://www.haomeiwen.com/subject/gjwbpftx.html