Skip to content Skip to sidebar Skip to footer

Node.js With Readfile Html But Not Loading/finding Jquery File

I'm having trouble loading my jquery file or any file for that matter in a node.js read html file. I spent quite some time on this and noticed that the web based google hosted libr

Solution 1:

You haven't actually serve the file if the current_url isn't "/", right now your server can only send the file content of index.html to the client.

You need to have something like the following in your "else" clause:

fs.readFile(file_path, 'utf8', function(errors, contents) {
    response.end(contents); 
});

Post a Comment for "Node.js With Readfile Html But Not Loading/finding Jquery File"