Skip to content

Commit 6f35679

Browse files
committed
health check url
1 parent 8b0fc5e commit 6f35679

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

index.js

+12-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require('dotenv').config();
22
const fs = require('fs');
3-
const { App } = require('@slack/bolt');
3+
const { App, ExpressReceiver } = require('@slack/bolt');
44
const FlexSearch = require("flexsearch");
55

66
let paperData = JSON.parse(fs.readFileSync('index.json'));
@@ -135,9 +135,18 @@ const matchPaperInSquareBrackets = (text) => {
135135
return result === null ? undefined : result[0];
136136
};
137137

138+
const receiver = new ExpressReceiver({
139+
signingSecret: process.env.SLACK_SIGNING_SECRET
140+
});
141+
138142
const app = new App({
139-
signingSecret: process.env.SLACK_SIGNING_SECRET,
140-
token: process.env.SLACK_BOT_TOKEN
143+
token: process.env.SLACK_BOT_TOKEN,
144+
receiver: receiver
145+
});
146+
147+
// health check
148+
receiver.app.get('/health', (_, res) => {
149+
res.status(200).send("app is running");
141150
});
142151

143152
const botMentioned = (messageText, botUserId) => {

0 commit comments

Comments
 (0)