I am currently working on a Node.js project with the following directory structure:
/web
/views
/css
asc.gif
bg.gif
desc.gif
tablesorter.css
index.jade
search.jade
server.js
Within my server.js
file, I render the search.jade
file.
Inside the search.jade
file, I have included the tablesortes.css
file like this:
style
include css/tablesorter.css
The content of tablesorter.css
references .gif files that are located in the same directory.
However, I am facing an issue where my code is unable to locate these .gif files (even though other styles from the tablesorter.css
file are working fine).
Currently, I have implemented a workaround by using the following code:
app.use(express.static('views/css'));
This workaround is placed within the server.js
file, but I am unsure if this is the best approach. Is there a more appropriate way to handle this?