From 164c9e37d7f8ad0cafc2649009bd66a78b74bcf1 Mon Sep 17 00:00:00 2001 From: "devin-ai-integration[bot]" <158243242+devin-ai-integration[bot]@users.noreply.github.com> Date: Wed, 25 Jun 2025 15:21:56 +0300 Subject: [PATCH] feat: add /v2/billing/webhook route to RawBodyMiddleware configuration (#22032) - Add /v2/billing/webhook alongside existing /api/v2/billing/webhook route - Both routes now use RawBodyMiddleware for proper Stripe webhook signature verification - Leverages NestJS forRoutes() method to accept multiple route configurations Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: morgan@cal.com --- apps/api/v2/src/app.module.ts | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/apps/api/v2/src/app.module.ts b/apps/api/v2/src/app.module.ts index b9bd76cfd7..6ec489bcba 100644 --- a/apps/api/v2/src/app.module.ts +++ b/apps/api/v2/src/app.module.ts @@ -86,10 +86,16 @@ export class AppModule implements NestModule { configure(consumer: MiddlewareConsumer): void { consumer .apply(RawBodyMiddleware) - .forRoutes({ - path: "/api/v2/billing/webhook", - method: RequestMethod.POST, - }) + .forRoutes( + { + path: "/api/v2/billing/webhook", + method: RequestMethod.POST, + }, + { + path: "/v2/billing/webhook", + method: RequestMethod.POST, + } + ) .apply(JsonBodyMiddleware) .forRoutes("*") .apply(RequestIdMiddleware)