内置模块/核心模块 (自带的)---http 服务器模块
http 服务器模块
createServer方法
const http = require('http');//导包
//http模块中的createServer方法用于创建一个服务器
//传入一个参数 为回调函数 createServer会向回调函数传入两个参数
//第一个是请求对象 第二个是响应对象
//createServer方法会有个返回值 返回值就代表这个服务器
const server = http.createServer((request,response) => {
原创
2020-08-17 10:11:00 ·
182 阅读 ·
0 评论