Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions lib/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,10 @@ var API = module.exports = function (opts) {
opts.api.path :
opts.api.port;
backend.on('error', function (err) {
return onError(err);
if (onError)
return onError(err);
else
console.error(err);
});

backend.init(function () {
Expand All @@ -729,7 +732,8 @@ var API = module.exports = function (opts) {

return server.listen(port_or_path, function () {
log.info('%s listening at %s', server.name, server.url);
return onInit();
if (onInit)
return onInit();
});

},
Expand Down