Skip to content

Commit 1991cd9

Browse files
committed
feat: add sample test route
1 parent c989035 commit 1991cd9

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

examples/echo-bot-ts/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ heroku config:set CHANNEL_SECRET=YOUR_CHANNEL_SECRET
8181
- Push the application to the server.
8282

8383
```bash
84+
git add .
85+
git commit -m "Initial commit for Heroku testing"
8486
git push heroku master
8587
```
8688

examples/echo-bot-ts/index.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,18 @@ const textEventHandler = async (event: WebhookEvent): Promise<MessageAPIResponse
4747
app.use(middleware(middlewareConfig));
4848

4949
// Route handler to receive webhook events.
50+
// This route is used to receive connection tests.
51+
app.get(
52+
'/',
53+
async (_: Request, res: Response): Promise<Response> => {
54+
return res.status(200).json({
55+
status: 'success',
56+
message: 'Connected successfully!',
57+
});
58+
}
59+
);
60+
61+
// This route is used for the Webhook.
5062
app.post(
5163
'/webhook',
5264
async (req: Request, res: Response): Promise<Response> => {

0 commit comments

Comments
 (0)