🔧(frontend) pass API and LiveKit server URLs through environment vars
Configured the frontend to use environment variables (prefixed with "VITE_") for API and LiveKit server URLs, which will be overridden in the Helm chart values to ensure correct URLs are used in different environments.
This commit is contained in:
2
src/frontend/.env.development
Normal file
2
src/frontend/.env.development
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
VITE_API_BASE_URL=http://localhost:8071/api/v1.0/
|
||||||
|
VITE_LIVEKIT_SERVER_URL=http://localhost:7880
|
||||||
@@ -4,8 +4,8 @@ import {LiveKitRoom, VideoConference} from "@livekit/components-react";
|
|||||||
|
|
||||||
import '@livekit/components-styles';
|
import '@livekit/components-styles';
|
||||||
|
|
||||||
const API_BASE_URL = 'http://localhost:8071/api/v1.0/'
|
const API_BASE_URL = import.meta.env.VITE_API_BASE_URL
|
||||||
const LIVEKIT_SERVER_URL = 'http://localhost:7880'
|
const LIVEKIT_SERVER_URL = import.meta.env.VITE_LIVEKIT_SERVER_URL
|
||||||
|
|
||||||
export interface User {
|
export interface User {
|
||||||
id: string;
|
id: string;
|
||||||
|
|||||||
8
src/frontend/src/vite-env.d.ts
vendored
8
src/frontend/src/vite-env.d.ts
vendored
@@ -1 +1,9 @@
|
|||||||
/// <reference types="vite/client" />
|
/// <reference types="vite/client" />
|
||||||
|
interface ImportMetaEnv {
|
||||||
|
readonly VITE_API_BASE_URL: string;
|
||||||
|
readonly VITE_LIVEKIT_SERVER_URL: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ImportMeta {
|
||||||
|
readonly env: ImportMetaEnv;
|
||||||
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user