This commit is contained in:
Mikan
2026-06-20 22:21:47 +03:00
parent 8514c63ec6
commit 0e1616d51c
12 changed files with 206 additions and 35 deletions

View File

@@ -29,7 +29,10 @@ import type {
WorldPreset,
} from "@/types";
const BASE_URL = "/api";
// Use VITE_API_BASE_URL if set (for local `npm run dev` pointing at a separate
// backend); otherwise default to relative "/api" which works behind the nginx
// reverse proxy in the Docker deployment.
const BASE_URL = (import.meta.env.VITE_API_BASE_URL as string | undefined)?.replace(/\/$/, "") || "/api";
const ACCESS_TOKEN_KEY = "airpg_access_token";
const REFRESH_TOKEN_KEY = "airpg_refresh_token";

9
frontend/src/vite-env.d.ts vendored Normal file
View File

@@ -0,0 +1,9 @@
/// <reference types="vite/client" />
interface ImportMetaEnv {
readonly VITE_API_BASE_URL?: string;
}
interface ImportMeta {
readonly env: ImportMetaEnv;
}