From 2108f403aa05f649a520faaa39a238840a2d3ee7 Mon Sep 17 00:00:00 2001 From: nico Date: Thu, 12 Mar 2026 12:06:16 +0800 Subject: [PATCH 1/2] Update .env.example to use relative URL '/' as default for NEXT_PUBLIC_BASE_URL This ensures the API uses the same protocol and domain as the frontend, preventing mixed content blocking in staging/production environments. Co-authored-by: Qwen-Coder --- .env.example | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.env.example b/.env.example index 06e9a18f..3208c010 100644 --- a/.env.example +++ b/.env.example @@ -12,10 +12,12 @@ WIBU_UPLOAD_DIR=uploads WIBU_DOWNLOAD_DIR=./download # Application Configuration -# For local development: NEXT_PUBLIC_BASE_URL=http://localhost:3000 -# For staging/production: Set to your actual domain (e.g., https://your-domain.com) -# Using relative URL '/' is recommended for deployment flexibility -NEXT_PUBLIC_BASE_URL=http://localhost:3000 +# IMPORTANT: For staging/production, set this to your actual domain +# Local development: NEXT_PUBLIC_BASE_URL=http://localhost:3000 +# Staging: NEXT_PUBLIC_BASE_URL=https://desa-darmasaba-stg.wibudev.com +# Production: NEXT_PUBLIC_BASE_URL=https://your-production-domain.com +# Or use relative URL '/' for automatic protocol/domain detection (recommended) +NEXT_PUBLIC_BASE_URL=/ # Email Configuration (for notifications/subscriptions) EMAIL_USER=your_email@gmail.com From f6f0e1093559787c105b81aec873ffc49fcf00a4 Mon Sep 17 00:00:00 2001 From: nico Date: Thu, 12 Mar 2026 12:11:10 +0800 Subject: [PATCH 2/2] Fix Url API Route --- MUSIK_CREATE_ANALYSIS.md | 1 + src/app/api/[[...slugs]]/route.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/MUSIK_CREATE_ANALYSIS.md b/MUSIK_CREATE_ANALYSIS.md index 84b5df96..0d749ab1 100644 --- a/MUSIK_CREATE_ANALYSIS.md +++ b/MUSIK_CREATE_ANALYSIS.md @@ -59,6 +59,7 @@ const corsConfig = { "http://localhost:3001", "https://cld-dkr-desa-darmasaba-stg.wibudev.com", "https://cld-dkr-staging-desa-darmasaba.wibudev.com", + "https://desa-darmasaba-stg.wibudev.com" ], methods: ["GET", "POST", "PATCH", "DELETE", "PUT", "OPTIONS"] as HTTPMethod[], allowedHeaders: ["Content-Type", "Authorization", "Accept"], diff --git a/src/app/api/[[...slugs]]/route.ts b/src/app/api/[[...slugs]]/route.ts index 55260576..d94bb7ab 100644 --- a/src/app/api/[[...slugs]]/route.ts +++ b/src/app/api/[[...slugs]]/route.ts @@ -52,6 +52,7 @@ const corsConfig = { "http://localhost:3001", "https://cld-dkr-desa-darmasaba-stg.wibudev.com", "https://cld-dkr-staging-desa-darmasaba.wibudev.com", + "https://desa-darmasaba-stg.wibudev.com", ], methods: ["GET", "POST", "PATCH", "DELETE", "PUT", "OPTIONS"] as HTTPMethod[], allowedHeaders: ["Content-Type", "Authorization", "Accept", "*"],