I have a question about node.js rest client restify. So I make request on server and I get a response (it prints nice on console) but when I shutdown my server my rest client chrashes with error :
events.js:72
throw er; // Unhandled 'error event
^
Error: read ECONNRESET
at errnoException (net.js:901:11
at TCP.onread (net.js:556:19
My code is simple :
var restify = require('restify');
// Creates a JSON client
var client = restify.createJsonClient({
url: 'http://127.0.0.1:3000/api/check'
});
client.get('', function(err, req, res, obj) {
console.log(obj); // print response
});
My server is also written in node.js and uses express framework and standard API which works for months on production so I doubt it is problem in that. Looks like client didn't close TCP connection to server but in restify tutorials I didn't find instructions to do that.
Thanks for any informations!