I have read many questions regarding \"unable to load js and css files from node js\". Looks like a silly path error but since am new to node js, am unable to figure it out. All
When node JS gets a request, you pass the requested path into a switch
statement.
If the request is for /socket.html
you return an HTML document.
If the request if for anything else (such as my.js
), you return a 404 error.
You have to return the JS and CSS when it is requested instead of throwing a 404.