Skip to content

Commit 1dbaf35

Browse files
authored
Update index.js
1 parent c6b68f7 commit 1dbaf35

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

app8/index.js

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,21 @@ const amIDead = () => {
2828
return deadFromRandom
2929
}
3030

31+
router.get('/', ctx => {
32+
ctx.status = iAmDead ? 500 : 200
33+
ctx.body = iAmDead ? 'broken' : 'app works'
34+
})
35+
3136
router.get('/healthz', ctx => {
3237
ctx.status = iAmDead ? 500 : 200
3338

3439
console.log(`Received a request to healthz and responding with status ${ctx.status}`)
3540
iAmDead = amIDead()
3641
})
3742

38-
3943
app.use(router.routes())
4044

4145
app.listen(PORT, () => {
4246
iAmDead = amIDead()
43-
console.log(`Started in port ${PORT}`)
47+
console.log(`Version ${version} started in port ${PORT}`)
4448
})

0 commit comments

Comments
 (0)