CognxSafeTrack commited on
Commit Β·
b4d0ff2
1
Parent(s): c4487e4
fix: remove hardcoded WhatsApp fallback and use environment variables
Browse files- .env.example +1 -1
- apps/web/src/App.tsx +2 -1
.env.example
CHANGED
|
@@ -40,7 +40,7 @@ R2_PUBLIC_URL= # Public URL of the bucket (e.g. https://pub-xxx.r2.
|
|
| 40 |
|
| 41 |
# βββ Frontend ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 42 |
VITE_CLIENT_URL=https://your-frontend.netlify.app
|
| 43 |
-
VITE_WHATSAPP_NUMBER=
|
| 44 |
|
| 45 |
# βββ Internal (Worker β API) βββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 46 |
API_URL=http://localhost:3001 # In prod: full URL of the Fastify API
|
|
|
|
| 40 |
|
| 41 |
# βββ Frontend ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 42 |
VITE_CLIENT_URL=https://your-frontend.netlify.app
|
| 43 |
+
VITE_WHATSAPP_NUMBER=221XXXXXXXXX # Replace with your production WhatsApp Bot number
|
| 44 |
|
| 45 |
# βββ Internal (Worker β API) βββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 46 |
API_URL=http://localhost:3001 # In prod: full URL of the Fastify API
|
apps/web/src/App.tsx
CHANGED
|
@@ -3,7 +3,8 @@ import { useEffect, useState } from 'react';
|
|
| 3 |
import { BookOpen, FileText, Smartphone, ArrowRight, Phone, CheckCircle, Download, AlertCircle } from 'lucide-react';
|
| 4 |
import PrivacyPolicy from './PrivacyPolicy';
|
| 5 |
|
| 6 |
-
const WA_NUMBER = import.meta.env.VITE_WHATSAPP_NUMBER || '
|
|
|
|
| 7 |
const API_URL = import.meta.env.VITE_API_URL || 'http://localhost:3001';
|
| 8 |
|
| 9 |
function Navbar() {
|
|
|
|
| 3 |
import { BookOpen, FileText, Smartphone, ArrowRight, Phone, CheckCircle, Download, AlertCircle } from 'lucide-react';
|
| 4 |
import PrivacyPolicy from './PrivacyPolicy';
|
| 5 |
|
| 6 |
+
const WA_NUMBER = import.meta.env.VITE_WHATSAPP_NUMBER || 'VITE_WHATSAPP_NUMBER_MISSING';
|
| 7 |
+
// NOTE: VITE_WHATSAPP_NUMBER must be set in the production environment (e.g. Railway/Netlify)
|
| 8 |
const API_URL = import.meta.env.VITE_API_URL || 'http://localhost:3001';
|
| 9 |
|
| 10 |
function Navbar() {
|