강현태

Add header

...@@ -28,11 +28,13 @@ router.post('/getPredict',function(req,res,next){ ...@@ -28,11 +28,13 @@ router.post('/getPredict',function(req,res,next){
28 } 28 }
29 }) 29 })
30 //csv포맷에 맞춰 출력 30 //csv포맷에 맞춰 출력
31 - let csv = normal_json.map((val)=>val.value).join(','); 31 + let csv1 = normal_json.map((val)=>val.name).join(',');
32 + let csv2 = normal_json.map((val)=>val.value).join(',');
33 + csv = csv1 + '\n' +csv2;
32 fs.writeFileSync('./inspection.csv',csv); 34 fs.writeFileSync('./inspection.csv',csv);
33 35
34 //스크립트 수행. 36 //스크립트 수행.
35 - const result = rscript.callSync('./test.R', {path : process.cwd()+'/inspection.csv'}); 37 + const result = rscript.callSync('/home/swc/capD/model/model.r', {path : process.cwd()+'/inspection.csv'});
36 res.json(result); 38 res.json(result);
37 }) 39 })
38 }); 40 });
......