I am trying to get superagent to work on the server side with relative path but it's not playing nicely.
The thought is, I need to proxy from the frontend to the backend with routes /api/*
being the proxy route. When doing a superagent request such as:
request.get('/api/surahs')
.end(function(err, res) {
debug('SURAHS RECEIVED....');
console.log(err);
actionContext.dispatch('surahsReceived', {surahs: res.body, surah: payload});
});
I always get error
[1] { [Error: connect ECONNREFUSED]
[1] code: 'ECONNREFUSED',
[1] errno: 'ECONNREFUSED',
[1] syscall: 'connect',
[1] response: undefined }
Any ideas?