-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.js
More file actions
31 lines (26 loc) · 1.26 KB
/
config.js
File metadata and controls
31 lines (26 loc) · 1.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
// Configuration file
// Set API URL for production or development
// For local development
// window.API_URL = 'http://localhost:3000';
// For production (replace with your backend URL)
// window.API_URL = 'https://your-backend.railway.app';
// หรือ
// window.API_URL = 'https://your-backend.render.com';
// Default: use localhost for development
// Override in production by setting this before loading other scripts
if (typeof window.API_URL === 'undefined') {
// Auto-detect: if running on localhost, use localhost API
if (window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1') {
window.API_URL = 'http://localhost:3000';
} else {
// Production: use same origin if backend is on same domain, or set your backend URL
// For Vercel deployment, you might need to set this to your backend URL
// Example: window.API_URL = 'https://your-backend.railway.app';
// For now, try to use same origin
window.API_URL = window.location.origin;
console.log('✅ Using same origin as API_URL:', window.API_URL);
}
}
// Smart Contract Address (Base Mainnet)
// Updated: Contract address deployed on Base Mainnet
window.CONTRACT_ADDRESS = '0x7303810b25c8F6f6c155b9bd7C0b4ef65D30356A';