fix: use relative URLs for API requests to fix CSP block in production
Build Institutional Trader / build-and-deploy (push) Successful in 1m57s Details

This commit is contained in:
Deep Koluguri 2026-06-24 19:30:05 -04:00
parent 7c67786e80
commit dfae02c851
4 changed files with 4 additions and 4 deletions

View File

@ -1,6 +1,6 @@
import { useState, useEffect, useCallback, useRef } from 'react';
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:3010';
const API_BASE = import.meta.env.VITE_API_URL || '';
// Formatters
function fmtPrice(n) {

View File

@ -1,6 +1,6 @@
import { useState, useEffect } from 'react';
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:3010';
const API_BASE = import.meta.env.VITE_API_URL || '';
function SentimentDot({ sentiment }) {
if (sentiment === 'BULLISH') return <span className="inline-block w-2 h-2 rounded-full bg-emerald-400 mr-2 flex-shrink-0" />;

View File

@ -1,6 +1,6 @@
import { useState, useEffect } from 'react';
const API_BASE = import.meta.env.VITE_API_URL || 'http://localhost:3010';
const API_BASE = import.meta.env.VITE_API_URL || '';
function fmt(n, decimals = 2, prefix = '') {
if (n == null || isNaN(n)) return '—';

View File

@ -4,7 +4,7 @@
*/
export const API_CONFIG = {
baseUrl: import.meta.env.VITE_API_URL || 'http://localhost:3010',
baseUrl: import.meta.env.VITE_API_URL || '',
wsUrl: import.meta.env.VITE_WS_URL || 'ws://localhost:5010',
timeout: parseInt(import.meta.env.VITE_API_TIMEOUT || '30000'),
retryAttempts: parseInt(import.meta.env.VITE_API_RETRY_ATTEMPTS || '3'),