Skip to content

Commit e1f25ba

Browse files
committed
fix: return fallback config if not production
1 parent 675798d commit e1f25ba

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

app/api/ab-config/route.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { NextResponse } from "next/server"
22

3-
import { IS_PREVIEW_DEPLOY } from "@/lib/utils/env"
3+
import { IS_PREVIEW_DEPLOY, IS_PROD } from "@/lib/utils/env"
44

55
import type { ABTestConfig, MatomoExperiment } from "@/lib/ab-testing/types"
66

@@ -33,7 +33,8 @@ const getPreviewConfig = () => ({
3333

3434
export async function GET() {
3535
// Preview mode: Show menu with original default
36-
if (IS_PREVIEW_DEPLOY) return NextResponse.json(getPreviewConfig())
36+
if (!IS_PROD || IS_PREVIEW_DEPLOY)
37+
return NextResponse.json(getPreviewConfig())
3738

3839
try {
3940
const matomoUrl = process.env.NEXT_PUBLIC_MATOMO_URL

0 commit comments

Comments
 (0)