Run the following commands:
npm init -y
npm install
To run the server use the commands:
node server.js
Server will be started at http://localhost:5000
- Save Files:
- Save 'server.js' and 'gameLogic.js' in your tic_tac_toe_node directory.
- Start the Server:
- Run 'node server.js' in your terminal.
- Access the Game:
- Open your browser and go to "http://localhost:5000/board" to see the current game board.
- Make moves by going to "http://localhost:5000/move/X/5" to place "X" in position 5, for example.
- Alternate turns between "X" and "O" by making valid move requests in sequence.
- Reset the game by visiting "http://localhost:5000/reset".