I am a complete node.js newbie and struggling with the basics.I have a html file and I would like to call external javascript file in the html page using node.js in local host environment.
Take the 2-minute tour
×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.
|
You just add the script tag into the html:
|
|||||||||
|
I think I have understood your real interest.
If you are trying to get a script tag (like that one above) working on your html, you should write a "router" inside your Node.js http.createServer callback. When the browser find the script tag, it will send a specific request to the server and then you can send the javascript code back on the response. I have written a way to do it on a similar question here: How to include javascript on client side of node.js?. |
|||
|