Express - res.send() works once

后端 未结 2 1368
灰色年华
灰色年华 2021-02-20 05:59

I\'m new to Node and Express, I was trying to make something with Express just to get started, then I faced this problem.

First res.send() works well, but t

2条回答
  •  名媛妹妹
    2021-02-20 06:54

    This is because res.send() finishes sending the response.

    When res.send('Hello'); is encountered it sends the response immediately. So next res.send is not executed and you cannot see visitors. Commenting the first res.send allows you to view the second one.

提交回复
热议问题