diff --git a/src/frontend/src/controllers/API/index.ts b/src/frontend/src/controllers/API/index.ts index f6f46404b..0cffd04bf 100644 --- a/src/frontend/src/controllers/API/index.ts +++ b/src/frontend/src/controllers/API/index.ts @@ -14,13 +14,13 @@ export async function sendAll(data: sendAllProps) { export async function checkCode( code: string ): Promise> { - return await axios.post("/validate/code", { code }); + return await axios.post("api/v1/validate/code", { code }); } export async function checkPrompt( template: string ): Promise> { - return await axios.post("/validate/prompt", { template }); + return await axios.post("api/v1/validate/prompt", { template }); } export async function getExamples(): Promise { diff --git a/src/frontend/src/modals/chatModal/index.tsx b/src/frontend/src/modals/chatModal/index.tsx index cf2b52aac..39bb72994 100644 --- a/src/frontend/src/modals/chatModal/index.tsx +++ b/src/frontend/src/modals/chatModal/index.tsx @@ -182,10 +182,10 @@ export default function ChatModal({ try { const urlWs = process.env.NODE_ENV === "development" - ? `ws://localhost:7860/chat/${id.current}` + ? `ws://localhost:7860/api/v1/chat/${id.current}` : `${window.location.protocol === "https:" ? "wss" : "ws"}://${ window.location.host - }/chat/${id.current}`; + }api/v1/chat/${id.current}`; const newWs = new WebSocket(urlWs); newWs.onopen = () => { console.log("WebSocket connection established!"); diff --git a/src/frontend/vite.config.ts b/src/frontend/vite.config.ts index 172b37733..d4fa2248b 100644 --- a/src/frontend/vite.config.ts +++ b/src/frontend/vite.config.ts @@ -11,7 +11,7 @@ const apiRoutes = [ ]; // Use environment variable to determine the target. -const target = process.env.VITE_PROXY_TARGET || "http://127.0.0.1:7860"; +const target = process.env.VITE_PROXY_TARGET || "http://127.0.0.1:7860/api/v1"; const proxyTargets = apiRoutes.reduce((proxyObj, route) => { proxyObj[route] = {