Trump Card Game for Sports built using Node, Express and Socket.io
Starting the server application
Install Node on your machine.
Navigate to the project directory using the terminal.
Before started the server application please ensure to use NPM to download and install any library dependencies before starting the server application. This can be done using the NPM in the terminal.
The server app that needs to run is server.js.
This can be run by simply typing node server into the terminal on the project directory.
The server will start and log Listening on *3000 to indicate the port no of the server app.
Running on the client device
Once the server is running, open a web browser and type localhost:3000. This will connect to the Node server application and the server will serve the index.html web page. When the page loads you are good to go and the client and server setup is successful. Repeat this process to open multiple clients as the game needs more than one user.
If you navigate back to your terminal you will see a message indicating a new client has connected.
Running the Application (TL;DR)
- Open terminal of the project folder
- npm install
- node server
- Check if it says Listening on *3000
- Open Browser. For player 1- Go to localhost:3000
- Open another tab in browser. For player 2 - Go to localhost:3000
- For player 2 . You can also play in phone. Get hostname of your computer. Then on mobile phone - open browser - go to computerhostname:3000
- Give names to each player. Play
Using the application
- log in
- click any user to challenge the user to a game
- play the game and enjoy 😀