feat: add .env based configuration for API, Web, and Auth options

This commit is contained in:
2026-04-08 01:24:49 -04:00
parent 31e0c5151b
commit 32b06afef6
76 changed files with 600 additions and 64 deletions

View File

@@ -22,3 +22,5 @@ dist-ssr
*.njsproj
*.sln
*.sw?
.env
.env.local

View File

@@ -52,7 +52,7 @@ const Dashboard: React.FC<DashboardProps> = ({ searchQuery }) => {
// Setup SSE connection
const token = localStorage.getItem('token');
const baseUrl = 'http://localhost:8000/api/v1'; // Or extract from api.defaults.baseURL
const baseUrl = import.meta.env.VITE_API_URL || 'http://localhost:8000/api/v1';
let url = `${baseUrl}/stream?token=${token}`;
if (searchQuery) {
url += `&search=${encodeURIComponent(searchQuery)}`;

View File

@@ -1,7 +1,7 @@
import axios from 'axios';
const api = axios.create({
baseURL: 'http://localhost:8000/api/v1',
baseURL: import.meta.env.VITE_API_URL || 'http://localhost:8000/api/v1',
});
api.interceptors.request.use((config) => {