Skip to content

Commit 67976d2

Browse files
fix: update NFC payload URL to use environment variable (#417)
1 parent 5744efe commit 67976d2

2 files changed

Lines changed: 4 additions & 1 deletion

File tree

.env.example

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ DATABASE_URL=postgresql://devcard:devcard@localhost:5432/devcard?schema=public
44
# ─── Redis ───
55
REDIS_URL=redis://localhost:6379
66

7+
# ─── Set The Url ───
8+
PUBLIC_APP_URL=
9+
710
# ─── JWT ───
811
# JWT_SECRET: any long random string, minimum 32 characters
912
# Generate with: node -e "console.log(require('crypto').randomBytes(32).toString('hex'))"

apps/backend/src/routes/nfc.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export async function nfcRoutes(app: FastifyInstance) {
100100
}
101101

102102
const safeUsername = encodeURIComponent(username);
103-
const payloadUrl = `https://dev-card.vercel.app/${safeUsername}${
103+
const payloadUrl = `${process.env.PUBLIC_APP_URL}/${safeUsername}${
104104
cardId ? `?card=${encodeURIComponent(cardId)}` : ''
105105
}`;
106106
const response: NfcPayloadResponse = {

0 commit comments

Comments
 (0)