Spaces:
Runtime error
Runtime error
Fix trailing slash double-slash API call issue
Browse files
frontend-react/src/services/api.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
| 1 |
import axios from 'axios';
|
| 2 |
|
| 3 |
-
const BACKEND_URL = import.meta.env.VITE_BACKEND_URL || 'http://localhost:8001';
|
| 4 |
const API_BASE = `${BACKEND_URL}/api/v1`;
|
| 5 |
const SESSION_KEY = '_jwt';
|
| 6 |
|
|
|
|
| 1 |
import axios from 'axios';
|
| 2 |
|
| 3 |
+
const BACKEND_URL = (import.meta.env.VITE_BACKEND_URL || 'http://localhost:8001').replace(/\/+$/, '');
|
| 4 |
const API_BASE = `${BACKEND_URL}/api/v1`;
|
| 5 |
const SESSION_KEY = '_jwt';
|
| 6 |
|