← 返回教程列表
🟢 Node.js 教程
HTTP服务器
const http = require("http");
const server = http.createServer((req, res) => {
res.writeHead(200, {"Content-Type": "text/plain"});
res.end("Hello World!");
});
server.listen(3000);const http = require("http");
const server = http.createServer((req, res) => {
res.writeHead(200, {"Content-Type": "text/plain"});
res.end("Hello World!");
});
server.listen(3000);