Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
parth-vora-7 opened this issue May 24, 2016 · 2 comments
Open

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

parth-vora-7 opened this issue May 24, 2016 · 2 comments

Comments

@parth-vora-7
Copy link

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:

<script src="socket.io.js"></script>

File have full permission.

Thanks

@bradbyte
Copy link

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
Copy link

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 ])).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants