最新消息: 电脑我帮您提供丰富的电脑知识,编程学习,软件下载,win7系统下载。

当使用req.end它打印在控制台两次。为什么?

IT培训 admin 7浏览 0评论

当使用req.end它打印在控制台两次。为什么?

我是新来的Node.js

什么是Node.js的。我使用req.end的使用,但它打印两次

app.use('/',function(req,res){
  res.send("hello world");  //send to browser
  console.log("by");  //print in console
  req.end;     //req is end here
}).listen(3000);
回答如下:
app.use('/',function(req,res){
  res.send("hello world");  //send to browser
  console.log("by");  //print in console
  req.end;     //req is end here
}).listen(3000);

在当你打本地主机上面的代码:3000 /从你的浏览器,浏览器打在同一时间一个图标两个请求,一个用于“/”端点与您共创只有“/”路由器,那么所有的请求将赶上“/”路线。当你打从邮递员该端点会在控制台打印一次。

当使用req.end它打印在控制台两次。为什么?

我是新来的Node.js

什么是Node.js的。我使用req.end的使用,但它打印两次

app.use('/',function(req,res){
  res.send("hello world");  //send to browser
  console.log("by");  //print in console
  req.end;     //req is end here
}).listen(3000);
回答如下:
app.use('/',function(req,res){
  res.send("hello world");  //send to browser
  console.log("by");  //print in console
  req.end;     //req is end here
}).listen(3000);

在当你打本地主机上面的代码:3000 /从你的浏览器,浏览器打在同一时间一个图标两个请求,一个用于“/”端点与您共创只有“/”路由器,那么所有的请求将赶上“/”路线。当你打从邮递员该端点会在控制台打印一次。

发布评论

评论列表 (0)

  1. 暂无评论