Open source video conferencing app powered by LiveKit. Built with Django and React.
🔧(frontend) pass API and LiveKit server URLs through environment vars
antoine lebaudf85a1efa2969
diff --git a/src/frontend/.env.development b/src/frontend/.env.developmentnew file mode 100644index 00000000..1a71fafa--- /dev/null+++ b/src/frontend/.env.development@@ -0,0 +1,2 @@+VITE_API_BASE_URL=http://localhost:8071/api/v1.0/+VITE_LIVEKIT_SERVER_URL=http://localhost:7880diff --git a/src/frontend/src/App.tsx b/src/frontend/src/App.tsxindex 52b7a7a8..1ce3cfff 100644--- a/src/frontend/src/App.tsx+++ b/src/frontend/src/App.tsx@@ -4,8 +4,8 @@ import {LiveKitRoom, VideoConference} from "@livekit/components-react";import '@livekit/components-styles';-const API_BASE_URL = 'http://localhost:8071/api/v1.0/'-const LIVEKIT_SERVER_URL = 'http://localhost:7880'+const API_BASE_URL = import.meta.env.VITE_API_BASE_URL+const LIVEKIT_SERVER_URL = import.meta.env.VITE_LIVEKIT_SERVER_URLexport interface User {id: string;diff --git a/src/frontend/src/vite-env.d.ts b/src/frontend/src/vite-env.d.tsindex 11f02fe2..a776d27c 100644--- a/src/frontend/src/vite-env.d.ts+++ b/src/frontend/src/vite-env.d.ts@@ -1 +1,9 @@/// <reference types="vite/client" />+interface ImportMetaEnv {+ readonly VITE_API_BASE_URL: string;+ readonly VITE_LIVEKIT_SERVER_URL: string;+}++interface ImportMeta {+ readonly env: ImportMetaEnv;+}