Randomblue
Randomblue

Reputation: 116303

Loading jQuery with NodeJS

I have a working HTML file with some javascript in it. I use NodeJS to send it to the client using fs.readFile() and response.write(). The problem with this is that, although the HTML renders fine, the javascript (which includes jQuery) doesn't load.

Upvotes: 0

Views: 597

Answers (1)

thejh
thejh

Reputation: 45578

You really shouldn't manually do "fs.readFile()" and "response.write()". Have a look at "lightnode" for serving static files: https://github.com/ngspinners/lightnode

Upvotes: 1

Related Questions