Skip to content

Commit

Permalink
feat: add health check/ping endpoint (#95)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebolam authored Jan 23, 2019
1 parent f47ad72 commit 0e45def
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
11 changes: 11 additions & 0 deletions serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,17 @@ functions:
path: /probot/stats
method: get
cors: true
healthCheck:
handler: src/serverless-health-check.handler
events:
- http:
path: /ping
method: get
cors: true
- http:
path: /health-check
method: get
cors: true

# Tasks
processIssueComment:
Expand Down
7 changes: 7 additions & 0 deletions src/serverless-health-check.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
module.exports.handler = async (event, context) => { // eslint-disable-line
// TODO: add real health check
return {
statusCode: 200,
body: 'Service is healthy',
}
}

0 comments on commit 0e45def

Please sign in to comment.