const express = require('express');
const app = express();
const hydra = require('hydra');
const config = require('./config.json');
app.get('/', (req, res) => res.send('Hello World!'));
app.listen(3000, () => console.log('Example app listening on port 3000!'));
hydra.init(config)
.then(() => {
console.log('hydra initiated');
return hydra.getServicePresence('hydra-router');
})
.then((service) => {
console.log(service);
})
.catch((error) => {
console.log(error)
});
Last active
February 19, 2018 04:00
-
-
Save cjus/f302dc8882d31f87f580f801e88aeb0d to your computer and use it in GitHub Desktop.
Hydra getServicePresence example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"hydra": { | |
"serviceName": "caller", | |
"serviceDescription": "", | |
"serviceIP": "", | |
"servicePort": 0, | |
"serviceType": "", | |
"redis": { | |
"url": "redis://localhost:6379/15" | |
} | |
} | |
} |
Array(1) [Object]
index.js:15
length:1
__proto__:Array(0) [, …]
0:Object {serviceName: "hydra-router", serviceDescription: "Service Router", version: "1.6.0", …}
hostName:"AdministorsMBP2.fios-router.home"
instanceID:"46bb1d0037264eb0898adde39cdd257e"
ip:"192.168.1.221"
port:1552
processID:10750
serviceDescription:"Service Router"
serviceName:"hydra-router"
updatedOn:"2018-02-19T03:55:52.114Z"
updatedOnTS:1519012552114
version:"1.6.0"
__proto__:Object {constructor: , __defineGetter__: , __defineSetter__: , …}
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment