mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2024-11-16 11:20:10 +01:00
force check api online via JSON response
This commit is contained in:
parent
8af817e2d5
commit
a62e891fa0
@ -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 () {
|
||||
|
@ -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";
|
||||
|
@ -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) => {
|
||||
|
Loading…
Reference in New Issue
Block a user