Skip to content

Commit 6869397

Browse files
committed
fix: change global middleware to local route middleware
1 parent 40dd2ab commit 6869397

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

examples/echo-bot-ts/index.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ const textEventHandler = async (event: WebhookEvent): Promise<MessageAPIResponse
4343
};
4444

4545
// Register the LINE middleware.
46-
// As an alternative, you could also pass the middleware in the route handler.
47-
app.use(middleware(middlewareConfig));
46+
// As an alternative, you could also pass the middleware in the route handler, which is what is used here.
47+
// app.use(middleware(middlewareConfig));
4848

4949
// Route handler to receive webhook events.
5050
// This route is used to receive connection tests.
@@ -61,6 +61,7 @@ app.get(
6161
// This route is used for the Webhook.
6262
app.post(
6363
'/webhook',
64+
middleware(middlewareConfig),
6465
async (req: Request, res: Response): Promise<Response> => {
6566
const events: WebhookEvent[] = req.body.events;
6667

0 commit comments

Comments
 (0)