mirror of
https://github.com/Mintplex-Labs/anything-llm.git
synced 2024-10-04 01:40:12 +02: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 = {
|
const System = {
|
||||||
ping: async function () {
|
ping: async function () {
|
||||||
return await fetch(`${API_BASE}/ping`)
|
return await fetch(`${API_BASE}/ping`)
|
||||||
.then((res) => res.ok)
|
.then((res) => res.json())
|
||||||
|
.then((res) => res?.online || false)
|
||||||
.catch(() => false);
|
.catch(() => false);
|
||||||
},
|
},
|
||||||
totalIndexes: async function () {
|
totalIndexes: async function () {
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
export const API_BASE =
|
export const API_BASE = import.meta.env.VITE_API_BASE || "/api";
|
||||||
import.meta.env.VITE_API_BASE || "/api";
|
|
||||||
|
|
||||||
export const AUTH_USER = "anythingllm_user";
|
export const AUTH_USER = "anythingllm_user";
|
||||||
export const AUTH_TOKEN = "anythingllm_authToken";
|
export const AUTH_TOKEN = "anythingllm_authToken";
|
||||||
|
@ -40,7 +40,7 @@ function systemEndpoints(app) {
|
|||||||
if (!app) return;
|
if (!app) return;
|
||||||
|
|
||||||
app.get("/ping", (_, response) => {
|
app.get("/ping", (_, response) => {
|
||||||
response.sendStatus(200);
|
response.status(200).json({ online: true });
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get("/migrate", async (_, response) => {
|
app.get("/migrate", async (_, response) => {
|
||||||
|
Loading…
Reference in New Issue
Block a user