feat: add .env based configuration for API, Web, and Auth options
This commit is contained in:
2
decnet_web/.gitignore
vendored
2
decnet_web/.gitignore
vendored
@@ -22,3 +22,5 @@ dist-ssr
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw?
|
||||
.env
|
||||
.env.local
|
||||
|
||||
@@ -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)}`;
|
||||
|
||||
@@ -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) => {
|
||||
|
||||
Reference in New Issue
Block a user