Consul + node.js watch function

Viewed 786

I am using node-consul as an SDK (latest version 0.23.0) for integrating with Consul in my node services. I am trying to watch list of services in the datacenter at the following way:

    var watch = this.client.watch({ method: this.client.catalog.services});
    watch.on('change', function(data, res) {
        //update services list
    });

    watch.on('error', function(err) {
        console.log('error:', err);
    });

this block always reach the onError code. What am i missing here? Thanks.

0 Answers
Related