arreglar localhost

This commit is contained in:
2026-01-17 22:24:56 -06:00
parent 64327ef5df
commit 153bdf2819
7 changed files with 43 additions and 13 deletions

View File

@@ -9,7 +9,7 @@ export const Dashboard: React.FC = () => {
const [isConnected, setIsConnected] = useState(false);
useEffect(() => {
const wsUrl = import.meta.env.VITE_WS_URL || 'ws://localhost:3003';
const wsUrl = window.APP_CONFIG?.VITE_WS_URL || import.meta.env.VITE_WS_URL || 'ws://localhost:3003';
const service = new WebSocketService(wsUrl);
setWsService(service);
@@ -34,7 +34,7 @@ export const Dashboard: React.FC = () => {
const fetchGatewayStatus = async () => {
try {
const apiUrl = import.meta.env.VITE_API_URL || 'http://localhost:3001';
const apiUrl = window.APP_CONFIG?.VITE_API_URL || import.meta.env.VITE_API_URL || 'http://localhost:3001';
const response = await fetch(`${apiUrl}/api/status`);
if (response.ok) {
const data = await response.json();

View File

@@ -1 +1,8 @@
/// <reference types="vite/client" />
interface Window {
APP_CONFIG?: {
VITE_API_URL: string;
VITE_WS_URL: string;
};
}