-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: added comments and fixed various code formatting
- Loading branch information
1 parent
faf0999
commit d3847d3
Showing
5 changed files
with
45 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
/* | ||
This is a simple command that replies with pong | ||
*/ | ||
|
||
export default { | ||
description: 'Replies with pong', | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,28 @@ | ||
/* | ||
This is the entry point for the Bolt app. It defines the express server that listens for incoming requests from Slack. | ||
*/ | ||
|
||
import express from 'express'; | ||
import logger from '../command-handler/src/util/logger.js'; | ||
|
||
// This function creates an express server that listens for incoming requests from Slack. | ||
export default (receiver) => { | ||
const app = express(); | ||
const log = logger(); | ||
// The port on which the express server will listen for incoming requests. | ||
// The default port is 5000, but it can be overridden by setting the SERVER_PORT environment variable. | ||
const port = process.env.SERVER_PORT || 5000; | ||
|
||
// Attach the receiver's request listener to the express server. | ||
app.use('/', receiver.router); | ||
|
||
// Define a simple health check route that returns a 200 status code. | ||
app.get('/', (req, res) => { | ||
res.sendStatus(200); | ||
}) | ||
}); | ||
|
||
// Start the express server. | ||
app.listen(port, () => { | ||
log.info(`The Bolt express server is listening on ${port}`) | ||
}) | ||
}); | ||
} |