Pancho Sanza Pancho Sanza - 3 years ago 126
Node.js Question

html5/nodejs/socketio developing while offline

node and

all is working well until hooking up the

script src=""></script

tag in the client html.
(this works fine while i have internet connection)

i have already tried some approaches to remedy this, they all just give me an
Loading failed for the with source “http://localhost:2000/js/

i would like to develop an application, but not need to be hooked up to the internet while i develop it.

here is an idea of what my structure is looking like:




---js//its here that ive tried storing various references to

---index.html //its into here that i am trying to inject the tag


---all the node modules, of particular interest:



i have been messing around trying to paste a copy of


in various location relative to the app.js file, but with no luck.

thanks for the help

Answer Source

I am not sure I understand your question entirely. One thing I have noticed is that does not exist. From the structure you are showing, I think you will have to include the client file like this:

<script src="/node_modules/"></script>

The above is true only if your node_modules is inside your document root. Otherwise, you won't be able to access it.

Otherwise, if you are also hosting the server side, you can also try this in your html file:

<script src="/"></script>

since the server part of will expose the client file at that location according to the documentation on

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download