var http = require('http'); //加载模块 server = http.createServer(function(req,res) { res.writeHead(200,{'Content-Type':'text/plain'}); res.end('hello world!'); }); //实例化 server.listen(8000); //监听8000端口 console.log('httpd start @8000')