Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion react-ystemandchess/src/environments/environment.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
};
7 changes: 3 additions & 4 deletions react-ystemandchess/src/features/engine/StockfishTutor.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1071,11 +1071,10 @@ const StockfishTutor: React.FC<Props> = ({ 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) {
Expand Down
Loading