建立一个简单的web server
作者:互联网
-
导入http模块
const http = require('http');
-
创建server
const server = http.createServer((req, res) => { res.end("Hello form the server!"); });
-
开启server
server.listen(8000, "127.0.0.1", () => { console.log("Listening to requests on port 8000."); });
标签:web,const,0.1,res,server,简单,http,8000 来源: https://www.cnblogs.com/kihyunBlog/p/16387547.html