Skip to content

Commit

Permalink
Removed few lines used to debug
Browse files Browse the repository at this point in the history
  • Loading branch information
Kanishka Dilshan committed Dec 28, 2018
1 parent e952507 commit 491fecf
Showing 1 changed file with 0 additions and 13 deletions.
13 changes: 0 additions & 13 deletions routes/reception.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,27 +70,14 @@ function processRequest(req, res, method, httpReception) {
value: headers[key]
})
}
const file = fs.createWriteStream('/home/kanishka/Desktop/node/test');

let chunks = [];
let finalBuffer;

//record request body
req.on('data', chunk => {
chunks.push(chunk);
console.log("temp" + chunks.length)

file.write(chunk, (error) => {
if (error != null) {
console.log(error);
res.send("IO Error!");
}
})
}).on('end', () => {//received all the data from the request
file.end();
finalBuffer = Buffer.concat(chunks);
console.log("DONE!" + finalBuffer.length);

//headers to be sent
const responseHeaders = [];
var idx = 0;
Expand Down

0 comments on commit 491fecf

Please sign in to comment.