Fix frontend API to use relative URLs through nginx proxy
Changed default API_BASE_URL from 'http://localhost:8000' to empty string so requests go through nginx proxy instead of trying to connect directly.
This commit is contained in:
@@ -1,6 +1,7 @@
|
|||||||
import axios from 'axios';
|
import axios from 'axios';
|
||||||
|
|
||||||
const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || 'http://localhost:8000';
|
// Use relative URLs to go through nginx proxy, or use env variable for direct connection
|
||||||
|
const API_BASE_URL = import.meta.env.VITE_API_BASE_URL || '';
|
||||||
|
|
||||||
const api = axios.create({
|
const api = axios.create({
|
||||||
baseURL: API_BASE_URL,
|
baseURL: API_BASE_URL,
|
||||||
|
|||||||
Reference in New Issue
Block a user