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 that contains the package.json

1
cd /var/www/minigames

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

1
npm install

Now, you can start the Mini Games 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 spearets screen session so tyhat the nodejs server contiunies to run in the background when we close outr main ssh session.

1
screen

Press enter.

Navigate to the mingames folder

1
cd /var/www/minigames

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.

To exit and end a screen session so that it no longer runs in the background, then while in the screen session, type exit. The screen session will no end and you cannot reconnect or reattach to it since it no longer exists.