-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8ca1a94
commit 1f7a925
Showing
1 changed file
with
8 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
import { hc } from "hono/client"; | ||
import type { AppType } from "$server"; | ||
|
||
export const client = ({ | ||
baseUrl = "https://api.linku.la/", | ||
fetchFunc = fetch, | ||
}: { | ||
baseUrl: string; | ||
fetchFunc: typeof fetch; | ||
}) => | ||
hc<AppType>(baseUrl, { | ||
fetch: fetchFunc, | ||
export const client = (args?: { | ||
baseUrl?: string; | ||
fetch?: typeof fetch; | ||
}) => { | ||
const { baseUrl, fetch } = args; | ||
return hc<AppType>(baseUrl, { | ||
fetch | ||
}); | ||
}; | ||
|
||
export type ApiType = AppType; |