Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

fix: update API URL handling in client initialization

Andrejc01daadfafcd
diff --git a/packages/libs/src/hono.ts b/packages/libs/src/hono.ts
index 0944c8f66..b8103bf8a 100644
--- a/packages/libs/src/hono.ts
+++ b/packages/libs/src/hono.ts
@@ -1,15 +1,18 @@
import type { AppType } from "@kaneo/api";
import { hc } from "hono/client";
-export const client = hc<AppType>("KANEO_API_URL", {
- fetch: (input: RequestInfo | URL, init?: RequestInit) => {
- return fetch(input, {
- ...init,
- headers: {
- ...init?.headers,
- "Content-Type": "application/json",
- },
- credentials: "include",
- });
+export const client = hc<AppType>(
+ import.meta.env.VITE_API_URL || "http://localhost:1337",
+ {
+ fetch: (input: RequestInfo | URL, init?: RequestInit) => {
+ return fetch(input, {
+ ...init,
+ headers: {
+ ...init?.headers,
+ "Content-Type": "application/json",
+ },
+ credentials: "include",
+ });
+ },
},
-});
+);