From b4b5cc3a3415e8b6ba6c557b8a0adeb3eaf6a730 Mon Sep 17 00:00:00 2001 From: roshankumar0036singh Date: Sat, 30 May 2026 22:23:00 +0530 Subject: [PATCH] fix: update NFC payload URL to use environment variable --- .env.example | 3 +++ apps/backend/src/routes/nfc.ts | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index ea17367b..ad7ce014 100644 --- a/.env.example +++ b/.env.example @@ -4,6 +4,9 @@ DATABASE_URL=postgresql://devcard:devcard@localhost:5432/devcard?schema=public # ─── Redis ─── REDIS_URL=redis://localhost:6379 +# ─── Set The Url ─── +PUBLIC_APP_URL= + # ─── JWT ─── # JWT_SECRET: any long random string, minimum 32 characters # Generate with: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))" diff --git a/apps/backend/src/routes/nfc.ts b/apps/backend/src/routes/nfc.ts index 0f8330c7..5cf13f0c 100644 --- a/apps/backend/src/routes/nfc.ts +++ b/apps/backend/src/routes/nfc.ts @@ -100,7 +100,7 @@ export async function nfcRoutes(app: FastifyInstance) { } const safeUsername = encodeURIComponent(username); -const payloadUrl = `https://dev-card.vercel.app/${safeUsername}${ +const payloadUrl = `${process.env.PUBLIC_APP_URL}/${safeUsername}${ cardId ? `?card=${encodeURIComponent(cardId)}` : '' }`; const response: NfcPayloadResponse = {