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 = {