Added checking of connection

This commit is contained in:
Patrick Alvin Alcala 2025-10-02 17:54:51 +08:00
parent 060741fcba
commit 58eb2cb472
4 changed files with 54 additions and 2 deletions

View file

@ -0,0 +1,13 @@
import { ofetch } from 'ofetch'
const API = import.meta.env.VITE_BACKEND
export default async () => {
try {
const check = await ofetch(API + 'check-connection')
const result = check.result
return result
} catch {
return false
}
}

View file

@ -0,0 +1 @@
export { default as checkConnection } from './checkConnection'