Skip to content

Commit

Permalink
fix: tsconfig
Browse files Browse the repository at this point in the history
  • Loading branch information
rubiin committed Oct 12, 2023
1 parent 02eddc9 commit 422e40f
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 8 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@
"@nestjs/schematics": "10.0.2",
"@nestjs/testing": "10.2.7",
"@rubiin/eslint-config": "^1.8.23",
"@rubiin/tsconfig": "^1.1.0",
"@rubiin/tsconfig": "^1.1.2",
"@sentry/types": "^7.73.0",
"@side/jest-runtime": "^1.1.0",
"@swc/core": "^1.3.92",
Expand Down
8 changes: 4 additions & 4 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

14 changes: 11 additions & 3 deletions src/app.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ import { ClearCacheMiddleware, RealIpMiddleware } from "@common/middlewares";
import { NestCacheModule } from "@lib/cache";
import { SharedModule } from "@modules/shared/shared.module";
import { AppController } from "app.controller";
import { SWAGGER_API_ENDPOINT } from "@common/constant";


const stripeWebhookPath = "stripe/webhook";
const excludedPaths = [stripeWebhookPath, SWAGGER_API_ENDPOINT];


@Module({
controllers: [AppController],
Expand All @@ -35,14 +41,16 @@ import { AppController } from "app.controller";
export class AppModule implements NestModule {
configure(consumer: MiddlewareConsumer) {
applyRawBodyOnlyTo(consumer, {
path: stripeWebhookPath,
method: RequestMethod.ALL,
path: "stripe/webhook",
});
consumer
.apply(RealIpMiddleware, ClearCacheMiddleware)
.exclude(
{ path: "stripe/webhook", method: RequestMethod.ALL },
{ path: "doc", method: RequestMethod.ALL },
...excludedPaths.map((path) => ({
path,
method: RequestMethod.ALL,
})),
)
.forRoutes({
path: "*",
Expand Down

0 comments on commit 422e40f

Please sign in to comment.