通过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入门