I have two different servers running on different machines and one server sending a .tar file to another, but I am not receiving the whole file only get one chunk of data.
Server 1 : Headers from the server I am sending the file :
Server 2 : Code where I am receiving that file through API
import fs from "fs";
this.post("/webhook",
async (req, res) => {
req.pipe(fs.createWriteStream(`./default.tar.gz`));
req.on("end", () => {
// have to update in db that file has been saved
});
})
Problem: If I run both servers on different machine stream doesn't work and only send one chunk of data however if I run both servers on the same machine it works perfectly fine.