diff --git a/frontend/src/models/system.js b/frontend/src/models/system.js index 9dc84001..d3f0f7e6 100644 --- a/frontend/src/models/system.js +++ b/frontend/src/models/system.js @@ -4,7 +4,8 @@ import { baseHeaders } from "../utils/request"; const System = { ping: async function () { return await fetch(`${API_BASE}/ping`) - .then((res) => res.ok) + .then((res) => res.json()) + .then((res) => res?.online || false) .catch(() => false); }, totalIndexes: async function () { diff --git a/frontend/src/utils/constants.js b/frontend/src/utils/constants.js index 18bb91ef..fe3a2308 100644 --- a/frontend/src/utils/constants.js +++ b/frontend/src/utils/constants.js @@ -1,5 +1,4 @@ -export const API_BASE = - import.meta.env.VITE_API_BASE || "/api"; +export const API_BASE = import.meta.env.VITE_API_BASE || "/api"; export const AUTH_USER = "anythingllm_user"; export const AUTH_TOKEN = "anythingllm_authToken"; diff --git a/server/endpoints/system.js b/server/endpoints/system.js index 5adf1446..8b1588a7 100644 --- a/server/endpoints/system.js +++ b/server/endpoints/system.js @@ -40,7 +40,7 @@ function systemEndpoints(app) { if (!app) return; app.get("/ping", (_, response) => { - response.sendStatus(200); + response.status(200).json({ online: true }); }); app.get("/migrate", async (_, response) => {