HLJ 发布于
2018-08-29 10:10:56

Node.js创建一个侦听端口的基本HTTP服务器

Node.js创建一个侦听端口的基本HTTP服务器
// include http module in the file
var http = require('http');
 
// create a server listening on 8087
http.createServer(function (req, res) {
    // write the response and send it to the client
    res.writeHead(200, {'Content-Type': 'text/html'}); 
    res.write('Node.js says hello!');
    res.end();
}).listen(8080);
当前文章内容为原创转载请注明出处:http://www.good1230.com/detail/2018-08-29/218.html
最后生成于 2023-06-18 18:30:24
此内容有帮助 ?
0