From 41292aace33e16ec64bbd73048510e4ca3a840eb Mon Sep 17 00:00:00 2001 From: Jake Bolam Date: Wed, 23 Jan 2019 06:49:19 -0500 Subject: [PATCH] feat: add health check/ping endpoint --- serverless.yml | 11 +++++++++++ src/serverless-health-check.js | 7 +++++++ 2 files changed, 18 insertions(+) create mode 100644 src/serverless-health-check.js diff --git a/serverless.yml b/serverless.yml index 40c92345..d20b49b2 100644 --- a/serverless.yml +++ b/serverless.yml @@ -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: diff --git a/src/serverless-health-check.js b/src/serverless-health-check.js new file mode 100644 index 00000000..2e30a276 --- /dev/null +++ b/src/serverless-health-check.js @@ -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', + } +}