Please help me with the following code where I am trying to make a synchronous get request in app.js and I want this method to be exposed to another file called index.js
Code for app.js
var qnamod = function(query) {
var request = require('sync-request');
var querystring = require('querystring').escape(query);
var resqna = request('GET', 'http://<host>/_analyse?question='+ querystring);
//console.log(res.getBody());
var qna = JSON.parse(resqna.getBody('utf8'));
}
exports.qnamod = qnamod;
Code for index.js
var counting = require('./app.js');
var resp = counting.qnamod("Forgot password");
console.log(resp);
On executing index.js I get the following error: INFO: Could not find files for the given pattern(s). Could not use "nc", falling back to slower node.js method for sync requests. undefined