Compare View
Commits (4)
Changes
Showing 3 changed files Side-by-side Diff
config.json
... | ... | @@ -0,0 +1 @@ |
1 | +{} |
heartbeat.js
... | ... | @@ -5,11 +5,12 @@ const request = require('request'); |
5 | 5 | const config = require('./config'); |
6 | 6 | const logger = require('./logger'); |
7 | 7 | const matrix = require('./matrix'); |
8 | +const core_url = require('./core-url'); | |
8 | 9 | |
9 | 10 | let module_type; |
10 | 11 | |
11 | 12 | function sendHeartbeat() { |
12 | - if (!config || !config.core_url || !module_type) { return; } | |
13 | + if (!config || !core_url || !module_type) { return; } | |
13 | 14 | |
14 | 15 | let heartbeat_name = config.handler_name || config.origin; |
15 | 16 | if (config.username) { |
... | ... | @@ -22,7 +23,7 @@ function sendHeartbeat() { |
22 | 23 | } |
23 | 24 | |
24 | 25 | const requestOptions = { |
25 | - uri: config.core_url + '/heartbeats', | |
26 | + uri: core_url + '/heartbeats', | |
26 | 27 | method: 'POST', |
27 | 28 | json: { |
28 | 29 | name: heartbeat_name, |
... | ... | @@ -32,9 +33,7 @@ function sendHeartbeat() { |
32 | 33 | } |
33 | 34 | } |
34 | 35 | |
35 | - request.post(requestOptions, function(err, res, body) { | |
36 | - | |
37 | - }); | |
36 | + request.post(requestOptions, function(err, res, body) { }); | |
38 | 37 | } |
39 | 38 | |
40 | 39 | setInterval( |