Added checking of connection
This commit is contained in:
parent
060741fcba
commit
58eb2cb472
4 changed files with 54 additions and 2 deletions
13
src/utils/functions/checkConnection.ts
Normal file
13
src/utils/functions/checkConnection.ts
Normal 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
|
||||
}
|
||||
}
|
||||
1
src/utils/functions/index.ts
Normal file
1
src/utils/functions/index.ts
Normal file
|
|
@ -0,0 +1 @@
|
|||
export { default as checkConnection } from './checkConnection'
|
||||
Loading…
Add table
Add a link
Reference in a new issue