diff --git a/backend/chessbot.js b/backend/chessbot.js index f98d1da..6c119b1 100644 --- a/backend/chessbot.js +++ b/backend/chessbot.js @@ -1,7 +1,8 @@ +const path = require("path"); const { Engine } = require("node-uci"); require("dotenv").config(); -const engine = new Engine(process.env.CHESS_ENGINE_PATH || "./engine/stockfish16.exe"); +const engine = new Engine(path.join(__dirname, process.env.CHESS_ENGINE_PATH || "engine/stockfish16.exe")); engine .init() @@ -10,6 +11,9 @@ engine }) .then((eng) => { eng.setoption("UCI_Elo"); + }) + .catch((err) => { + console.error(err); }); const nextMove = async ({ position }) => { diff --git a/backend/dockerfile b/backend/dockerfile index 4352023..0179c69 100644 --- a/backend/dockerfile +++ b/backend/dockerfile @@ -15,6 +15,6 @@ RUN npm install --silent COPY . . # Exports -EXPOSE 5000 +EXPOSE 8080 -CMD ["npm","start"] \ No newline at end of file +CMD ["node","app.js"] \ No newline at end of file