node 创建服务器方法
方法一
let http = require('http')
let httpserver = http.createServer(function(req,res){
res.writeHead(200,{'Content-type':'text/plain'})
res.end("hello!666666")
})
httpserver.listen(3000,()=>{
console.log('正在监听 localhost:3000');
});
方法二
let express = require('express');
let app = express();
app.listen(3000,()=>{
console.log('正在监听 localhost:3000');
});