diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2025-10-22 14:04:58 +0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-10-22 13:04:58 +0300 |
| commit | 7d84d53d4b95732319d0b19c180201a14491068d (patch) | |
| tree | 0d91473700c0dbcce65c5cf61821cab43e9a7d34 /frontend/src | |
| parent | feat/frontend: switch to vite, update node to v22 (#281) (diff) | |
| download | lphub-7d84d53d4b95732319d0b19c180201a14491068d.tar.gz lphub-7d84d53d4b95732319d0b19c180201a14491068d.tar.bz2 lphub-7d84d53d4b95732319d0b19c180201a14491068d.zip | |
fix/frontend: use API url based on environment (#282)v1.0.4
Diffstat (limited to '')
| -rw-r--r-- | frontend/src/api/Api.ts | 4 | ||||
| -rw-r--r-- | frontend/src/vite-env.d.ts | 2 |
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 | ||
| 52 | const BASE_API_URL: string = "https://lp.portal2.sr/api/v1/" | 52 | const BASE_API_URL: string = import.meta.env.DEV |
| 53 | ? "https://lp.portal2.sr/api/v1/" | ||
| 54 | : "/api/v1/" | ||
| 53 | 55 | ||
| 54 | export function url(path: string): string { | 56 | export 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 | |||