Skip to content

Commit ef8b94e

Browse files
committed
[ui] Set default API URL to '/'
Sets the default API base URL to 'http://localhost:8000' only in development mode and '/' in every other case. The base URL can be changed with the 'VITE_API_ENDPOINT' env variable. Signed-off-by: Eva Millán <[email protected]>
1 parent 4f12f17 commit ef8b94e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ui/src/services/api/client.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import axios from 'axios'
22

3-
const base = import.meta.env.VITE_API_ENDPOINT || 'http://localhost:8000'
3+
const defaultBase = import.meta.env.MODE === 'development' ? 'http://localhost:8000' : "/"
4+
const base = import.meta.env.VITE_API_ENDPOINT || defaultBase
45

56
export const client = axios.create({
67
baseURL: base,

0 commit comments

Comments
 (0)