Config ausgelagert
This commit is contained in:
parent
0dd4236e11
commit
236bf4aa51
@ -16,8 +16,8 @@ app.get('/', (req, res) => res.send('Hello world!'))
|
|||||||
|
|
||||||
app.get('/animals/', function (req, res) {
|
app.get('/animals/', function (req, res) {
|
||||||
var options = {
|
var options = {
|
||||||
hostname: '127.0.0.1',
|
hostname: config.get('service.001.host'),
|
||||||
port: 4001,
|
port: config.get('service.001.port'),
|
||||||
path: '/animals/',
|
path: '/animals/',
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
headers: { 'Content-Type': 'application/json' }
|
headers: { 'Content-Type': 'application/json' }
|
||||||
@ -45,7 +45,7 @@ app.get('/animals/', function (req, res) {
|
|||||||
});
|
});
|
||||||
|
|
||||||
req.on('error', function(e) {
|
req.on('error', function(e) {
|
||||||
console.error('Problem with request: ' + e.message);
|
console.error('Problem with request: ' + e.message)
|
||||||
res.status(500).send("ERROR")
|
res.status(500).send("ERROR")
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@ -1,3 +1,9 @@
|
|||||||
{
|
{
|
||||||
"secret": "myverysecuresecret"
|
"secret": "myverysecuresecret",
|
||||||
|
"service": {
|
||||||
|
"001": {
|
||||||
|
"host": "127.0.0.1",
|
||||||
|
"port": 4001
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user