diff --git a/src/supervisor.coffee b/src/supervisor.coffee index 544e24d3..4efde59b 100644 --- a/src/supervisor.coffee +++ b/src/supervisor.coffee @@ -37,7 +37,18 @@ module.exports = class Supervisor extends EventEmitter # FIXME: rearchitect proxyvisor to avoid this circular dependency # by storing current state and having the APIBinder query and report it / provision devices @deviceState.applications.proxyvisor.bindToAPI(@apiBinder) - @api = new SupervisorAPI({ @config, @eventTracker, routers: [ @apiBinder.router, @deviceState.router ], healthchecks: [ @apiBinder.healthcheck, @deviceState.healthcheck ] }) + @api = new SupervisorAPI({ + @config, + @eventTracker, + routers: [ + @apiBinder.router, + @deviceState.router + ], + healthchecks: [ + @apiBinder.healthcheck.bind(@apiBinder), + @deviceState.healthcheck.bind(@deviceState) + ] + }) init: => @db.init()