Closed h2non closed 9 years ago
Useful when using multiple discovery servers as Consul:
var client = Resilient() var consulMiddleware = require('resilient-consul') client.use(consulMiddleware({ service: 'api' })) // Middleware implementation function (params) { return function (options, resilient) { // Interface return { type: 'discovery', in: function (options, next) { options.qs.service = 'test' next() }, out: function (res, req, next) { var servers = res.body.map(function (item) { return item.nested.url }) next(null, servers) } } } }
Done!
Useful when using multiple discovery servers as Consul: