I have a strange problem that I cannot understand with expressjs. I have specified a public folder for all static files like js, css and images. I am using app.use(express.static(__dirname + '/public')); to specify a folder. This works great, except in one case.
In the shared folder, I have 3 folders named js , css and images . In one of my css files, I am doing background-image: url(/images/bg.png) no-repeat; , but this URL is not allowed, and the image does not appear on the page.
However, if I do something like img(src='/images/bg.png') from one of my views, the image shows. I assume this is due to the fact that I am linking to a static file, and node / express ignore all routes (?) From static files.
How can I link image links in css files located inside a static folder in an expression?
Vaheh source share