var http = require('http');
var server = new http.createServer(handlerRequest(req,res));
server.listen(8888);
function handlerRequest(req,res){
res.end('hellow');
}
为什么报错说req未定义,createServer只接受匿名函数吗?
2023-12-06 08:29:28
var http = require('http');
var server = new http.createServer(handlerRequest(req,res));
server.listen(8888);
function handlerRequest(req,res){
res.end('hellow');
}
为什么报错说req未定义,createServer只接受匿名函数吗?