學習nodejs之hello world

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')
相關文章
相關標籤/搜索