通过js创建个简单的web服务器
var http=require('http'); http.createServer(function(req,res){ res.writeHead(200,{'Content-Type':'text/html'}); res.end("server is up!"); }).listen(8000); console.log('listened on 8000');
推荐学习:Node入门
通过js创建个简单的web服务器
var http=require('http'); http.createServer(function(req,res){ res.writeHead(200,{'Content-Type':'text/html'}); res.end("server is up!"); }).listen(8000); console.log('listened on 8000');
推荐学习:Node入门
转载于:https://www.cnblogs.com/jasonzeng/p/4200726.html