environemnt availability

This commit is contained in:
2025-07-06 23:50:48 +03:00
parent 4d7b5019d3
commit f3610a70d4
4 changed files with 23 additions and 15 deletions

View File

@@ -1,4 +1,12 @@
# API Configuration
VITE_API_URL=http://141.196.166.241:8003
# Vercel Deployment Configuration
NEXT_PUBLIC_ALLOWED_HOSTS=141.196.166.241
NEXT_PUBLIC_VERCEL_URL=${VERCEL_URL}
NODE_ENV=production
# CORS Configuration
CORS_ORIGIN=*
# Add other environment variables as needed

View File

@@ -58,18 +58,6 @@ npm run preview
- Resource Distribution Visualization
- System Maintenance
## API Configuration
The application connects to an API server at `http://141.196.166.241:8003`. Make sure this endpoint is accessible from your network.
## Environment Variables
No additional environment variables are required to run the application in development mode.
## Browser Support
The application is optimized for modern browsers that support ES6+ features.
## Environment Configuration
The application uses environment variables for configuration. To set up your environment:
@@ -84,6 +72,6 @@ cp .env.example .env
VITE_API_URL=http://your-api-server:port
```
The following environment variables are available:
## Browser Support
- `VITE_API_URL`: The URL of the API server (default: http://141.196.166.241:8003)
The application is optimized for modern browsers that support ES6+ features.

View File

@@ -1,6 +1,10 @@
// Environment configuration
const getApiUrl = (): string => {
// Use environment variable if available, fallback to development URL
// In production (Vercel), use the proxied path
if (import.meta.env.PROD) {
return '/api';
}
// In development, use the direct URL
return import.meta.env.VITE_API_URL || 'http://141.196.166.241:8003';
};

8
vercel.json Normal file
View File

@@ -0,0 +1,8 @@
{
"rewrites": [
{
"source": "/api/:path*",
"destination": "http://141.196.166.241:8003/:path*"
}
]
}