Skip to content

Commit 46edc12

Browse files
author
colto
committed
Fix frontend API base URL for production
1 parent 1f9ae75 commit 46edc12

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

frontend/src/api.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
export const API_BASE_URL = import.meta.env.VITE_API_BASE_URL as string;
1+
const rawBase = import.meta.env.VITE_API_BASE_URL;
2+
export const API_BASE_URL = (rawBase ? String(rawBase) : "").replace(/\/+$/, "");
23

34
export type ServiceInstance = {
45
id: number;
@@ -32,4 +33,4 @@ export async function createService(input: {
3233
}
3334

3435
return res.json();
35-
}
36+
}

0 commit comments

Comments
 (0)