diff options
Diffstat (limited to 'server/frontend/src/api.ts')
-rw-r--r-- | server/frontend/src/api.ts | 6 |
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 }); |