Socket io cannot find the route

Asked

Viewed 116 times

-2

all right?

I am instantiating the socket as IO and when using io.on('Connection', Function()) it ends up not falling inside my io.on when accessing the page, it does not return any messages and in debug mode it does not even go through the route, could you give me some light? Thank you!

Follows project: https://github.com/henrique-nofv/socketIoChat

1 answer

1


Henrique, observing his code in github HTML with the client socket (public/index.html): inserir a descrição da imagem aqui

I noticed that you imported the library from the socket but did not call the same to make the connection to your server.

Example:

<script>
  const socket = io('http://localhost');
</script>

Browser other questions tagged

You are not signed in. Login or sign up in order to post.