Fix API endpoint configuration with environment-aware URLs

- Add environment-based API URL configuration (dev: localhost:8000, prod: api.pennyzo.com)
- Update PennyzoApiService to use centralized config with timeout settings
- Fix API status checker scripts to load .env variables using dotenv
- Add environment management scripts (set-env.ps1) with npm shortcuts
- Create comprehensive configuration testing and validation tools
- Add TypeScript definitions for Vite environment variables
- Update all documentation with new environment configuration instructions
- Install dotenv package for Node.js environment variable loading
- All APIs now correctly use environment-appropriate URLs automatically
This commit is contained in:
2025-09-25 14:40:20 +05:30
parent aece15a286
commit ebb7fcaac8
15 changed files with 742 additions and 11 deletions

View File

@@ -5,6 +5,7 @@
"dependencies": {
"axios": "^1.12.2",
"chalk": "^4.1.2",
"dotenv": "^17.2.2",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"typescript": "^4.9.0"
@@ -28,6 +29,10 @@
"api:check": "node scripts/api-status-checker.js",
"api:check:extended": "node scripts/api-status-checker-extended.js",
"api:check:verbose": "node scripts/api-status-checker-extended.js --verbose",
"api:check:real": "node scripts/api-status-checker-extended.js --use-real-credentials"
"api:check:real": "node scripts/api-status-checker-extended.js --use-real-credentials",
"api:test-config": "node scripts/test-config.js",
"env:dev": "powershell -ExecutionPolicy Bypass -File scripts/set-env.ps1 dev",
"env:prod": "powershell -ExecutionPolicy Bypass -File scripts/set-env.ps1 prod",
"env:show": "powershell -ExecutionPolicy Bypass -File scripts/set-env.ps1 -Show"
}
}