13 lines
250 B
TypeScript
13 lines
250 B
TypeScript
import { ofetch } from 'ofetch'
|
|
|
|
const API = import.meta.env.VITE_BACKEND
|
|
|
|
export default async (api: string) => {
|
|
try {
|
|
const fetch = await ofetch(API + api)
|
|
const result = fetch.result
|
|
return result
|
|
} catch {
|
|
return false
|
|
}
|
|
}
|