Difference between response.send and response.write in node js

后端 未结 4 622
耶瑟儿~
耶瑟儿~ 2020-12-01 01:31

I have written a small API which uses the Node js \"restify\" framework. This API receives a request (actually anything after \"/\") and then send that request to another se

4条回答
  •  执念已碎
    2020-12-01 02:05

    res.send() is part of Express.js instead of pure Node.js.

    Just an side observation. My app sometimes send back a very large Json object ( HighChart object that contains over 100k points). With res.send() sometimes it hangs and choke up the server, whereas res.write() and res.end() handle it just fine.

    I also noticed a memory spike when res.send() is invoked.

提交回复
热议问题