File tree 1 file changed +12
-3
lines changed
1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change 1
1
require ( 'dotenv' ) . config ( ) ;
2
2
const fs = require ( 'fs' ) ;
3
- const { App } = require ( '@slack/bolt' ) ;
3
+ const { App, ExpressReceiver } = require ( '@slack/bolt' ) ;
4
4
const FlexSearch = require ( "flexsearch" ) ;
5
5
6
6
let paperData = JSON . parse ( fs . readFileSync ( 'index.json' ) ) ;
@@ -135,9 +135,18 @@ const matchPaperInSquareBrackets = (text) => {
135
135
return result === null ? undefined : result [ 0 ] ;
136
136
} ;
137
137
138
+ const receiver = new ExpressReceiver ( {
139
+ signingSecret : process . env . SLACK_SIGNING_SECRET
140
+ } ) ;
141
+
138
142
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" ) ;
141
150
} ) ;
142
151
143
152
const botMentioned = ( messageText , botUserId ) => {
You can’t perform that action at this time.
0 commit comments