This repository contains a small demo application with a small NodeJS + Socket.io backend and a vanilla JS + Socket.io frontend client. It also integrates a small Local Storage demo.
In order to run this demo, you need to have a newer version of NodeJS (v12+) installed.
You can clone the repository from the commandline with
# clone the repository
$ git clone https://github.com/JanTrichter/Node_Websockets.git
# move into the server directory
$ cd Node_Websockets/server/
# install packages (npm)
$ npm i
Now you can start the server.
# run the server
$ node .
Console should print:
Server is listening on http://localhost:8080
Now you can open the index.html
which is located in the client
folder.
You should open the index.html
with another browser or in an incognito tab to get a better demonstration. If you just duplicate the browser window the messages will have the same sender because the sender is stored in the browser's Local Storage.