var http = require(‘http‘); //引用名称控件 server = http.createServer(function(req,res) { res.writeHead(200,{‘Content-Type‘:‘text/plain‘}); res.end(‘hello world!‘); }); //创建http server server.listen(8000); //监听8000端口 console.log(‘httpd start @8000‘)
时间: 2024-12-25 08:40:40