Play a classic against your friends. Online! On mobile and Desktop!
In order to install all dependencies use the following commands:
npm install
cd client
npm install
In order for the game to work, you have to make the following adjustments:
- open the file "socket-server.js" and choose a port you want the socket to run on.
- Go to the folder "pages" and open the "Main.js" file and look for the following line of code:
...
React.useEffect(() => {
const socket = io();
socket.emit("setname", getItem("nickname"));
...
- Add "http://127.0.0.1:" as an argument to the
ìo()
function. has to be the same port your server listens to.
For developement you can start the server and client at the same time by using the following command:
npm run dev
The game can be viewed here: https://king-pong-nf.herokuapp.com/;