Start the Games on the server

Video Lecture

Start the Games on the server Start the Games on the server

Description

Navigate into the folder on your new server that contains the package.json

1
cd /var/www/ballgame.your-domain.tld

Now, install the packages from the package.json by using the command,

1
npm install

Now, you can start the The Ball Game game server.

1
npm start

Now open a browser and visit http://[your ip address]:3000

Go back into SSH and press Ctrl-C to stop the server.

We will now start it in a separate screen session so that the nodejs server continues to run in the background when we close our main ssh session.

1
screen

Press enter.

Navigate to the ballgame folder again while in the new screen session.

1
cd /var/www/ballgame.your-domain.tld

And start the node js server

1
npm start

Press CTRL-A and CTRL-D to detach from the screen session.

The nodejs server is still running in the background and will still continue to run if we close our main SSH session.

To go back into an existing screen session, type

1
screen -r 

See video for more details about using screen.

If you want to end and exit a screen session fully so that it no longer is running in the background. Then, while in the screen session, type exit. The screen session will now end and you will not be able to reconnect or reattach to the old session, since it no longer exists, until you create a new session.

Remember, screen is useful when you want your process to continue after you close your main ssh client, putty in our case.