aboutsummaryrefslogtreecommitdiff
path: root/frontend
diff options
context:
space:
mode:
authorArda Serdar Pektezol <1669855+pektezol@users.noreply.github.com>2025-10-22 14:04:58 +0400
committerGitHub <noreply@github.com>2025-10-22 13:04:58 +0300
commit7d84d53d4b95732319d0b19c180201a14491068d (patch)
tree0d91473700c0dbcce65c5cf61821cab43e9a7d34 /frontend
parentfeat/frontend: switch to vite, update node to v22 (#281) (diff)
downloadlphub-1.0.4.tar.gz
lphub-1.0.4.tar.bz2
lphub-1.0.4.zip
fix/frontend: use API url based on environment (#282)v1.0.4
Diffstat (limited to 'frontend')
-rw-r--r--frontend/src/api/Api.ts4
-rw-r--r--frontend/src/vite-env.d.ts2
2 files changed, 5 insertions, 1 deletions
diff --git a/frontend/src/api/Api.ts b/frontend/src/api/Api.ts
index df787e3..19ece86 100644
--- a/frontend/src/api/Api.ts
+++ b/frontend/src/api/Api.ts
@@ -49,7 +49,9 @@ export const API = {
49 delete_map_summary: (token: string, map_id: string, route_id: number) => delete_map_summary(token, map_id, route_id), 49 delete_map_summary: (token: string, map_id: string, route_id: number) => delete_map_summary(token, map_id, route_id),
50}; 50};
51 51
52const BASE_API_URL: string = "https://lp.portal2.sr/api/v1/" 52const BASE_API_URL: string = import.meta.env.DEV
53 ? "https://lp.portal2.sr/api/v1/"
54 : "/api/v1/"
53 55
54export function url(path: string): string { 56export function url(path: string): string {
55 return BASE_API_URL + path; 57 return BASE_API_URL + path;
diff --git a/frontend/src/vite-env.d.ts b/frontend/src/vite-env.d.ts
new file mode 100644
index 0000000..ed77210
--- /dev/null
+++ b/frontend/src/vite-env.d.ts
@@ -0,0 +1,2 @@
1/// <reference types="vite/client" />
2