Skip to content

Commit

Permalink
Add status checker endpoint
Browse files Browse the repository at this point in the history
This is used by status.hackclub.com
  • Loading branch information
maxwofford committed Feb 23, 2022
1 parent 8df31a5 commit a43533a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
8 changes: 8 additions & 0 deletions src/controller.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import Botkit from 'botkit'
import redisStorage from 'botkit-storage-redis'
import { get } from 'lodash'
import { transcript } from './utils'

const controller = new Botkit.slackbot({
clientId: process.env.SLACK_CLIENT_ID,
Expand Down Expand Up @@ -166,6 +167,13 @@ controller.setupWebserver(process.env.PORT || 3000, (err, webserver) => {
controller.createWebhookEndpoints(controller.webserver)
controller.createOauthEndpoints(controller.webserver)
controller.createHomepageEndpoint(controller.webserver)

webserver.get('/ping', (req, res) => {
res.json({
pong: true,
message: transcript('statusCheck')
})
})
})

export default controller
3 changes: 2 additions & 1 deletion src/utils/transcript.yml
Original file line number Diff line number Diff line change
Expand Up @@ -732,4 +732,5 @@ gamelab:
_I've set an auto-reply using <@U017VA2PN3V> until on Fri, Feb 25th_
<https://hackclub.slack.com/archives/C0P5NE354/p1644606215597029|HELP!!!1!>
melabEmoji: gamelab
warningEmoji: warning
warningEmoji: warning
statusCheck: pong!

0 comments on commit a43533a

Please sign in to comment.