Skip to content

Commit 0e45def

Browse files
authored
feat: add health check/ping endpoint (#95)
1 parent f47ad72 commit 0e45def

File tree

2 files changed

+18
-0
lines changed

2 files changed

+18
-0
lines changed

serverless.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,17 @@ functions:
5656
path: /probot/stats
5757
method: get
5858
cors: true
59+
healthCheck:
60+
handler: src/serverless-health-check.handler
61+
events:
62+
- http:
63+
path: /ping
64+
method: get
65+
cors: true
66+
- http:
67+
path: /health-check
68+
method: get
69+
cors: true
5970

6071
# Tasks
6172
processIssueComment:

src/serverless-health-check.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
module.exports.handler = async (event, context) => { // eslint-disable-line
2+
// TODO: add real health check
3+
return {
4+
statusCode: 200,
5+
body: 'Service is healthy',
6+
}
7+
}

0 commit comments

Comments
 (0)