diff --git a/react-ystemandchess/src/environments/environment.js b/react-ystemandchess/src/environments/environment.js index bbdeb1fc..abdffcf2 100644 --- a/react-ystemandchess/src/environments/environment.js +++ b/react-ystemandchess/src/environments/environment.js @@ -6,7 +6,7 @@ export const environment = { urls: { middlewareURL: 'http://localhost:8000', stockfishServerURL: 'http://localhost:8080', // unified naming - chessServerURL: 'http://localhost:8080', // point to mock stockfish server for testing + chessServerURL: 'http://localhost:3001', // chessServer (socket.io game state) }, productionType: 'development', // development/production }; \ No newline at end of file diff --git a/react-ystemandchess/src/features/engine/StockfishTutor.tsx b/react-ystemandchess/src/features/engine/StockfishTutor.tsx index eea1668e..c5643794 100644 --- a/react-ystemandchess/src/features/engine/StockfishTutor.tsx +++ b/react-ystemandchess/src/features/engine/StockfishTutor.tsx @@ -1071,11 +1071,10 @@ const StockfishTutor: React.FC = ({ enabled, trigger, fenBefore, fenAfter // eslint-disable-next-line no-console console.debug('StockfishTutor: analyzing move', { fenBefore, fenAfter, moveUci, uciHistory }); try { setDebugLog(`analyzing move ${moveUci} | fenBefore=${fenBefore.split(' ')[0]}...`); } catch (e) { /* ignore */ } - // Safely read environment URL keys + // Stockfish analysis endpoint (/api/analyze) is hosted on stockfishServerURL. + // chessServerURL is websocket-only and does not handle HTTP analysis. const urls = (environment && (environment as any).urls) || {}; - // Support multiple environment keys: prefer unified chessServerURL but - // also accept stockfishServerURL (some deployments use that name). - const rawBase = urls.chessServerURL || urls.stockfishServerURL || urls.chessServer || urls.stockfishServer || ''; + const rawBase = urls.stockfishServerURL || urls.stockfishServer || ''; const baseUrl = typeof rawBase === 'string' ? rawBase.replace(/\/$/, '') : ''; if (!baseUrl) {