diff --git a/server.js b/server.js index 33392ca..9a74970 100644 --- a/server.js +++ b/server.js @@ -46,17 +46,17 @@ function callInitFileMover(re) { // A chunk of data has been received. resp.on('data', (chunk) => { + data += chunk; + }); + + // The whole response has been received. Print out the result. + resp.on('end', () => { //debug data = `{ "construction_id": 3, "file_name": "ini_データ入力シート.xlsx", "file_type": "dataSheet" }` - data += chunk; - }); - - // The whole response has been received. Print out the result. - resp.on('end', () => { if(data !== 'no match'){ resdata = JSON.parse(data); console.log(resdata);