Using WebSockets via Socket.IO to enable a multi-player word-guessing game.
-
yarn install
to install packages -
a.
yarn dev
to run in development modeb.
yarn build
andyarn start
to build and start production server -
Enjoy at
http://localhost:3000/
This was my second time trying out WebSockets to see how they work. Overall they're quite simple to add to use but I haven't looked into the best practices and so have just used it in a way that I thought made sense.
Vercel doesn't support WebSocket connections - so something else like Heroku should be used for hosting. Alternatively, the WebSocket functionality could be reimplemented with Pusher, but I haven't looked into a good open source option and I'd rather self-host.
Inspired by Semantle.
Seeing as this was an attempt to just try WebSockets, no attempts were made to style this project so it looks 🤮