灏天阁

NODEJS[22]:http模块_HTTP响应练习

· Yin灏
const http = require("http");
const server = http.createServer((request, response) => {
  response.end(`
    <!DOCTYPE html>
    <html lang="en">
    <head>
      <meta charset="UTF-8">
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>Document</title>
    </head>
    <body>
      <table></table>
    </body>
    </html>
  `);
});
server.listen(9000, () => {
  cons.log("服务器已经启动了...");
});

- Book Lists -