Spaces:
Sleeping
Sleeping
Tristan Yu commited on
Commit ·
e73efbb
1
Parent(s): 6f53819
FIXED: Double /api issue by using environment variable properly
Browse files- src/services/api.ts +5 -5
src/services/api.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
| 1 |
import axios from 'axios';
|
| 2 |
|
| 3 |
// Create axios instance with base configuration
|
| 4 |
-
// FORCE REBUILD:
|
| 5 |
const api = axios.create({
|
| 6 |
-
baseURL: 'https://linguabot-transcreation-backend.hf.space/api',
|
| 7 |
headers: {
|
| 8 |
'Content-Type': 'application/json',
|
| 9 |
},
|
|
@@ -11,13 +11,13 @@ const api = axios.create({
|
|
| 11 |
});
|
| 12 |
|
| 13 |
// Debug: Log the API URL being used
|
| 14 |
-
console.log('🔧 API CONFIGURATION DEBUG -
|
| 15 |
-
console.log('API Base URL: https://linguabot-transcreation-backend.hf.space/api');
|
| 16 |
console.log('Environment variables:', {
|
| 17 |
REACT_APP_API_URL: process.env.REACT_APP_API_URL,
|
| 18 |
NODE_ENV: process.env.NODE_ENV
|
| 19 |
});
|
| 20 |
-
console.log('Build timestamp:', new Date().toISOString()); // Force rebuild -
|
| 21 |
|
| 22 |
// Request interceptor to add auth token and user role
|
| 23 |
api.interceptors.request.use(
|
|
|
|
| 1 |
import axios from 'axios';
|
| 2 |
|
| 3 |
// Create axios instance with base configuration
|
| 4 |
+
// FORCE REBUILD: Fixed double /api issue by using environment variable
|
| 5 |
const api = axios.create({
|
| 6 |
+
baseURL: process.env.REACT_APP_API_URL || 'https://linguabot-transcreation-backend.hf.space/api',
|
| 7 |
headers: {
|
| 8 |
'Content-Type': 'application/json',
|
| 9 |
},
|
|
|
|
| 11 |
});
|
| 12 |
|
| 13 |
// Debug: Log the API URL being used
|
| 14 |
+
console.log('🔧 API CONFIGURATION DEBUG - FIXED DOUBLE /API ISSUE:');
|
| 15 |
+
console.log('API Base URL:', process.env.REACT_APP_API_URL || 'https://linguabot-transcreation-backend.hf.space/api');
|
| 16 |
console.log('Environment variables:', {
|
| 17 |
REACT_APP_API_URL: process.env.REACT_APP_API_URL,
|
| 18 |
NODE_ENV: process.env.NODE_ENV
|
| 19 |
});
|
| 20 |
+
console.log('Build timestamp:', new Date().toISOString()); // Force rebuild - Fixed double /api issue
|
| 21 |
|
| 22 |
// Request interceptor to add auth token and user role
|
| 23 |
api.interceptors.request.use(
|