Skip to content

Commit

Permalink
Merge pull request #14 from ErezWeiss/main
Browse files Browse the repository at this point in the history
add an healthcheck route
  • Loading branch information
chenbishop authored Sep 12, 2024
2 parents e705d08 + d9f53bb commit 0bea37d
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions app.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -172,13 +172,24 @@ async function initApp(app) {
const app = new App({
token: slackToken,
signingSecret: slackSigningSecret,
ignoreSelf: false
ignoreSelf: false,
customRoutes: [
{
path: '/healthcheck',
method: ['GET'],
handler: (req, res) => {
res.writeHead(200, { 'Content-Type': 'application/json' });
res.end(JSON.stringify({ status: 'OK' }));
},
},
],
});

await initApp(app);

await app.start(process.env.PORT || port);
console.log(`⚡️ Slack Bolt app is running on port ${port}!`);

console.log(`Healthcheck endpoint available at http://localhost:${port}/healthcheck`);
// todo: confirm the block below is not preventing the bot to accept event in Cloudrun without no cpu throttling
console.log(`Checking all expired duration based accesses are revoked.`)
await startUpCleanUp(app)
Expand Down

0 comments on commit 0bea37d

Please sign in to comment.