Skip to content
This repository was archived by the owner on Nov 5, 2025. It is now read-only.

Commit bdaa179

Browse files
committed
fix: WIP
1 parent 2f98796 commit bdaa179

File tree

4 files changed

+18
-1
lines changed

4 files changed

+18
-1
lines changed

front/nginx.conf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ server {
88
try_files $uri /index.html =404;
99
}
1010

11+
location /api/ {
12+
proxy_pass http://server:8080/;
13+
proxy_set_header Host $host;
14+
}
15+
1116
location /client.apk {
1217
alias /shared/client.apk;
1318
}

front/src/api_url.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1-
export const API_BASE_URL = "http://127.0.0.1:8080";
1+
export const API_BASE_URL = import.meta.env.PROD
2+
? "/api"
3+
: "http://127.0.0.1:8080";

front/src/routes/login/index.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ export default function LoginPage() {
2121
password: "",
2222
});
2323

24+
console.log(API_BASE_URL);
25+
2426
const REGISTRATION_FIELDS = [
2527
{
2628
label: "Email",

front/vite-env.d.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,12 @@
22

33
/// <reference types="vite/client" />
44

5+
interface ImportMetaEnv {
6+
readonly PROD: boolean;
7+
}
8+
9+
interface ImportMeta {
10+
readonly env: ImportMetaEnv;
11+
}
12+
513
declare const __APP_PLATFORM__: "mobile" | "web";

0 commit comments

Comments
 (0)