소스 검색

Return meaningful response

jmacura 5 년 전
부모
커밋
07ee2a05fb
1개의 변경된 파일2개의 추가작업 그리고 4개의 파일을 삭제
  1. 2 4
      index.js

+ 2 - 4
index.js

@@ -132,10 +132,8 @@ app.get('/runR', (req, res, next) => {
         function(err, data) {
             console.log('R done');
             if (err) console.log(err.toString('utf8'))
-            else {
-							console.log(data);
-              data = {result: 'R call succesful'};
-						}
+            else console.log(data);
+            if (!data) data = {result: 'R call succesful'}
             helpers.formatResponse({ response: data }, req, res);
         }
     );