Config ausgelagert

This commit is contained in:
Gerrit Linnemann 2017-12-18 20:20:56 +01:00
parent 0dd4236e11
commit 236bf4aa51
2 changed files with 10 additions and 4 deletions

View File

@ -16,8 +16,8 @@ app.get('/', (req, res) => res.send('Hello world!'))
app.get('/animals/', function (req, res) {
var options = {
hostname: '127.0.0.1',
port: 4001,
hostname: config.get('service.001.host'),
port: config.get('service.001.port'),
path: '/animals/',
method: 'GET',
headers: { 'Content-Type': 'application/json' }
@ -45,7 +45,7 @@ app.get('/animals/', function (req, res) {
});
req.on('error', function(e) {
console.error('Problem with request: ' + e.message);
console.error('Problem with request: ' + e.message)
res.status(500).send("ERROR")
});

View File

@ -1,3 +1,9 @@
{
"secret": "myverysecuresecret"
"secret": "myverysecuresecret",
"service": {
"001": {
"host": "127.0.0.1",
"port": 4001
}
}
}