冒泡3的課件(2023.4.1提前預(yù)告)
// http,url模塊
//
// 用module(模塊)
// 將很多很多的功能
nodejs將很多功能劃分為module(模塊)
很多功能都是通過模塊實(shí)現(xiàn)
//----------------------------------------------------------
//http
//課程3.1 介紹http模塊
//我們已經(jīng)介紹了http模塊了!
var http=require('http');
var server=http.createServer(function () {
})
//監(jiān)聽端口
server.listen();
// ---------------------------------------------------
//拓展一下
var http=require('http');
var server=http.createServer(function (req,res) {
? ?console.log("服務(wù)器server接收到請求"+req.url);
? ?res.end();
})
//監(jiān)聽端口
server.listen(3000,"127.0.0.1");
標(biāo)簽: