I am developing a nodejs application using the Jade template engine.
Inside my main("/") layout I have the following code that loads external CSS in my public path.
link(rel='stylesheet', href='/stylesheets/styles.css')
...
there are multiple lines of external javascript and css files to be loaded.
However, When I have to load it from my /users/profile jade template the link is broken.
It says
GET http://localhost:3000/users/javascripts/underscore.js 404 (Not Found)
Is there a way to have a set of links that works in all of my Jade template so I don't have to manually redefine them everytime?
Thanks in advance, Dennis
If you are using express do it like this:
app.use(express.static(__dirname + '/public'));
link(rel='stylesheet', href='/stylesheets/styles.css') this will make following http request: GET http://localhost:3000/stylesheets/styles.css and express will look for the file in directory: ~/public/stylesheets/styles.css
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With