From a9516202fefef191a828554b537bfb8b69041813 Mon Sep 17 00:00:00 2001 From: pablonyx Date: Thu, 12 Dec 2024 09:07:30 -0800 Subject: [PATCH] update conditional (#3446) --- web/src/app/api/[...path]/route.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/web/src/app/api/[...path]/route.ts b/web/src/app/api/[...path]/route.ts index 0ebd8210a81..b777995f2a3 100644 --- a/web/src/app/api/[...path]/route.ts +++ b/web/src/app/api/[...path]/route.ts @@ -61,7 +61,12 @@ export async function OPTIONS( } async function handleRequest(request: NextRequest, path: string[]) { - if (process.env.NODE_ENV !== "development") { + if ( + process.env.NODE_ENV !== "development" && + // NOTE: Set this environment variable to 'true' for preview environments + // Where you want finer-grained control over API access + process.env.OVERRIDE_API_PRODUCTION !== "true" + ) { return NextResponse.json( { message: