I recently learned socket.io and I made a simple app with it, and then published it on a heroku app.
They say you should write this code in your html document for socket.io:
<script> $(document).ready(function () { const socket = io(); $('form').submit((e) => { e.preventDefault(); socket.emit('chat message', $('#m').val()); $('#m').val(''); return false; }); socket.on('chat message', (msg) => { $('#messages').append(`<li>Message: ${msg}</li>`); }); });This is from socket.io's documentation page.
Solved! Solved! Go to Solution.
Hey @SebastianElstadt, Thanks for coming back to share what worked for you!
Mark helpful posts with Accept as Solution to help other users locate important info. Don't forget to give Kudos for great content!