Commit ·
3576188
1
Parent(s): 491d80b
update api base url
Browse files
.env.example
CHANGED
|
@@ -1,2 +1,2 @@
|
|
| 1 |
-
VITE_API_URL=http://localhost:8000
|
| 2 |
-
VITE_WS_URL=ws://localhost:8000
|
|
|
|
| 1 |
+
VITE_API_URL=http://localhost:8000
|
| 2 |
+
VITE_WS_URL=ws://localhost:8000
|
src/services/api/axiosClient.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
| 1 |
import axios, { AxiosInstance, AxiosError } from "axios";
|
| 2 |
|
|
|
|
|
|
|
| 3 |
const axiosClient: AxiosInstance = axios.create({
|
| 4 |
-
baseURL:
|
| 5 |
});
|
| 6 |
|
| 7 |
axiosClient.interceptors.request.use((request) => {
|
|
|
|
| 1 |
import axios, { AxiosInstance, AxiosError } from "axios";
|
| 2 |
|
| 3 |
+
const baseURL = import.meta.env.VITE_API_URL as string;
|
| 4 |
+
|
| 5 |
const axiosClient: AxiosInstance = axios.create({
|
| 6 |
+
baseURL: `${baseURL}/api/v1`,
|
| 7 |
});
|
| 8 |
|
| 9 |
axiosClient.interceptors.request.use((request) => {
|
src/services/websockets/conversation.ts
CHANGED
|
@@ -5,6 +5,6 @@ const baseURL = import.meta.env.VITE_WS_URL as string;
|
|
| 5 |
export function conversationWebSocket(data: IConversationWebSocket): WebSocket {
|
| 6 |
const token = localStorage.getItem("auth_token");
|
| 7 |
return new WebSocket(
|
| 8 |
-
`${baseURL}/conversations?conversation_id=${data.conversationId}&modality=${data.modality}&token=${token}`
|
| 9 |
);
|
| 10 |
}
|
|
|
|
| 5 |
export function conversationWebSocket(data: IConversationWebSocket): WebSocket {
|
| 6 |
const token = localStorage.getItem("auth_token");
|
| 7 |
return new WebSocket(
|
| 8 |
+
`${baseURL}/ws/v1/conversations?conversation_id=${data.conversationId}&modality=${data.modality}&token=${token}`
|
| 9 |
);
|
| 10 |
}
|