https://github.com/caseywebdev/watch-consul
A simple utility for watching a JSON key on a consul server and triggering a callback initially and whenever a change occurs.
https://github.com/caseywebdev/watch-consul
Last synced: over 1 year ago
JSON representation
A simple utility for watching a JSON key on a consul server and triggering a callback initially and whenever a change occurs.
- Host: GitHub
- URL: https://github.com/caseywebdev/watch-consul
- Owner: caseywebdev
- Created: 2016-05-20T20:44:30.000Z (about 10 years ago)
- Default Branch: master
- Last Pushed: 2016-05-24T15:16:19.000Z (about 10 years ago)
- Last Synced: 2025-01-30T21:30:50.104Z (over 1 year ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 6
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# watch-consul
A simple utility for watching a JSON key on a consul server and triggering a
callback initially and whenever a change occurs.
```js
import watchConsul from 'watch-consul';
const watch = () =>
watchConsul({url: 'my-consul-server:8500', key: '/my/key/to/watch'})
.then(console.log.bind(console))
.catch(console.error.bind(console))
.then(watch);
watch();
```