File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 11require ( 'dotenv' ) . config ( ) ;
22const fs = require ( 'fs' ) ;
3- const { App } = require ( '@slack/bolt' ) ;
3+ const { App, ExpressReceiver } = require ( '@slack/bolt' ) ;
44const FlexSearch = require ( "flexsearch" ) ;
55
66let 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+
138142const 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
143152const botMentioned = ( messageText , botUserId ) => {
You can’t perform that action at this time.
0 commit comments