Skip to content
This repository was archived by the owner on Apr 3, 2019. It is now read-only.

Commit 89f5cac

Browse files
rfkvladikoff
authored andcommitted
fix(routes): Add a /__lbheartbeat__ route. (#1807) r=vladikoff
1 parent 9ac11ac commit 89f5cac

File tree

2 files changed

+26
-0
lines changed

2 files changed

+26
-0
lines changed

lib/routes/defaults.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,14 @@ module.exports = (log, db) => {
8787
)
8888
}
8989
},
90+
{
91+
method: 'GET',
92+
path: '/__lbheartbeat__',
93+
handler: function heartbeat(request, reply) {
94+
log.begin('Defaults.lbheartbeat', request)
95+
reply({})
96+
}
97+
},
9098
{
9199
method: '*',
92100
path: '/v0/{p*}',

test/remote/misc_tests.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,24 @@ describe('remote misc', function() {
6565
}
6666
)
6767

68+
it(
69+
'/__heartbeat__ returns a 200 OK',
70+
() => {
71+
return request(config.publicUrl + '/__heartbeat__').spread((res) => {
72+
assert.equal(res.statusCode, 200, 'http ok')
73+
})
74+
}
75+
)
76+
77+
it(
78+
'/__lbheartbeat__ returns a 200 OK',
79+
() => {
80+
return request(config.publicUrl + '/__lbheartbeat__').spread((res) => {
81+
assert.equal(res.statusCode, 200, 'http ok')
82+
})
83+
}
84+
)
85+
6886
it(
6987
'/ returns version, git hash and source repo',
7088
testVersionRoute('/')

0 commit comments

Comments
 (0)