aboutsummaryrefslogtreecommitdiff
path: root/server/frontend/src/api.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/frontend/src/api.ts')
-rw-r--r--server/frontend/src/api.ts6
1 files changed, 6 insertions, 0 deletions
diff --git a/server/frontend/src/api.ts b/server/frontend/src/api.ts
new file mode 100644
index 0000000..22cf6ca
--- /dev/null
+++ b/server/frontend/src/api.ts
@@ -0,0 +1,6 @@
+import createClient from "openapi-fetch";
+import type { paths } from "./api-schema.js";
+
+const apiRoot = import.meta.env.DEV ? "//localhost:8080/api" : "/api";
+
+export const client = createClient<paths>({ baseUrl: apiRoot });