tambahan
This commit is contained in:
11
src/client/lib/apiFetch.ts
Normal file
11
src/client/lib/apiFetch.ts
Normal file
@@ -0,0 +1,11 @@
|
||||
import type { AppServer } from '@/index'
|
||||
import { treaty } from '@elysiajs/eden'
|
||||
|
||||
const URL = process.env.BUN_PUBLIC_BASE_URL
|
||||
if (!URL) {
|
||||
throw new Error('BUN_PUBLIC_BASE_URL is not defined')
|
||||
}
|
||||
|
||||
const apiFetch = treaty<AppServer>(URL)
|
||||
|
||||
export default apiFetch
|
||||
Reference in New Issue
Block a user