arreglar localhost
This commit is contained in:
@@ -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();
|
||||
|
||||
7
manager/src/vite-env.d.ts
vendored
7
manager/src/vite-env.d.ts
vendored
@@ -1 +1,8 @@
|
||||
/// <reference types="vite/client" />
|
||||
|
||||
interface Window {
|
||||
APP_CONFIG?: {
|
||||
VITE_API_URL: string;
|
||||
VITE_WS_URL: string;
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user