diff --git a/backend/.env.example b/backend/.env.example index ec910fc..7eba8b4 100644 --- a/backend/.env.example +++ b/backend/.env.example @@ -12,4 +12,4 @@ CONNECTION_STRING= PORT=8080 # path to the chess engine -CHESS_ENGINE_PATH= \ No newline at end of file +CHESS_ENGINE_PATH=./engine/stockfish16.exe \ No newline at end of file diff --git a/backend/chessbot.js b/backend/chessbot.js index 988d181..f98d1da 100644 --- a/backend/chessbot.js +++ b/backend/chessbot.js @@ -1,10 +1,7 @@ -const chess = require("chess.js"); const { Engine } = require("node-uci"); -const engine = new Engine( - process.env.CHESS_ENGINE_PATH || - "C:\\Users\\MOON\\Downloads\\stockfish-windows-x86-64-avx2\\stockfish\\stockfish-windows-x86-64-avx2.exe" -); +require("dotenv").config(); +const engine = new Engine(process.env.CHESS_ENGINE_PATH || "./engine/stockfish16.exe"); engine .init() diff --git a/backend/engine/stockfish16 b/backend/engine/stockfish16 new file mode 100644 index 0000000..b9cc8c2 Binary files /dev/null and b/backend/engine/stockfish16 differ