|
|
@@ -131,11 +131,14 @@ app.get('/runR', (req, res, next) => {
|
|
|
R('./r/selected_data.r').call(
|
|
|
function(err, data) {
|
|
|
console.log('R done');
|
|
|
- if (err) console.log(err.toString('utf8'))
|
|
|
+ if (err) {
|
|
|
+ console.log(err.toString('utf8'));
|
|
|
+ data = { result: err.toString('utf8') };
|
|
|
+ }
|
|
|
else {
|
|
|
- console.log(data);
|
|
|
- data = {result: 'R call succesful'};
|
|
|
- }
|
|
|
+ console.log(data);
|
|
|
+ data = { result: 'R call succesful' };
|
|
|
+ }
|
|
|
helpers.formatResponse({ response: data }, req, res);
|
|
|
}
|
|
|
);
|