rauchg / chat-example

797 stars 2.05k forks source link

How to include socket.io.js (client) file in html? #24

Open parth-vora-7 opened 8 years ago

parth-vora-7 commented 8 years ago

Hello,

I want to include socket.io.js (client) file into index.html without using CDN. I have put socket.io.js into project's root directory. But when I'm trying to open the chat on browser, I'm getting 404 for that file. Here is my cod to include that file:

File have full permission.

Thanks

bradbyte commented 8 years ago

I had the same issue when I was using this along with Express. I was starting the server with app.listen() instead of http.listen(). Once I changed it the 404 error went away.

unusualpseudo commented 7 years ago

add this line to the server to start serving static file such as the file socket.io.js : app.use(express.static([put the path where your static files exists ])).