Flotype / now

NowJS makes it easy to build real-time web apps using JavaScript
http://www.nowjs.com
MIT License
1.91k stars 175 forks source link

Failed to load resource: The requested URL was not found on this server. socket.io.js #128

Closed inator closed 13 years ago

inator commented 13 years ago

I get the above safari console error when running the multi-chat-room example with the client run local and the server on my host. multiroomchat.html is being run locally via file:// and calling the now.js via method as prescribed. I also get:

TypeError: 'undefined' is not a function (evaluating 'now.changeRoom($(this).text())') when I click a different room link, which indicates to me that the now.js script is not passing functions or listening for events.

If I run the client html file from the server via http://myserver:my port (which serves up the client html file) .. all is fine.

I have found no examples of a split client and server implementation. Can now.js not be run this way? What do I need to do to get the split implementation working with the example? I imagine others have a need to host the client front end locally as I do for compiled native mobile apps - where the server is completely independent.

Please help.

Thanks much!

steveWang commented 13 years ago

You'll need to host the client-side now.js in this case (use the file that's auto-hosted; it's configured to your server), and modify it to use http://... instead of // on the line that starts with var uri = ....

inator commented 13 years ago

Thanks! That did the trick. I had to allow the server to generate the now.js file dynamically, by going to the url directly in the browser with the node.js server running, then saving the resulting file for self-hosting locally. Made the change as suggested and all is good.

eddymankim commented 11 years ago

Hello inator, I am a complete web dev noob. I am running into a similar problem with my node app that I'm trying to deploy through Cloud Foundry. Could I trouble you for a more step-by-step explanation of how you went about this fix? Thank you.