the browser does not recognize the socket.io library

0

I was making an application that connects from a web page to a socket server. It turns out that when I run the website the browser is not able to find the socket.io library

Browser code index.html:

<!DOCTYPE html>
        <html lang="en">
        <head>
          <meta charset="UTF-8">
          <title>My Aplicación con Sockets</title>
          <script src="/socket.io/socket.io.js"></script>
          <script src="main.js"></script>
        </head>
        <body>
          <h1>My App</h1>
          <div id="messages"></div>
          <br/>
          <form onsubmit="return addMessage(this)">
            <input type="text" id="title" placeholder="titulo de notificacion" >
            <input type="text" id="body" placeholder="cuerpo de la notificacion">
            <input type="submit" value="Enviar!">
          </form>
        </body>
        </html>

in the javascript code of the browser gives me trouble with this line

var socket = io.connect('http://localhost:8080', { 'forceNew': true });

The browser shows the following error: GET link net :: ERR_ABORTED 404 (Not Found)

    
asked by k1k4ss0 24.09.2018 в 13:38
source

0 answers