This is the structure of my folders (with views located in the root directory):
views/contractor/auth/login.ejs
When I access that file, the CSS styles are not being applied. The connection to the CSS file, which is located in the public directory in the root folder, seems to be broken:
public/assets/css/styles.css
Here's a snippet from my app.js file (located in the root directory):
app.set("view engine", "ejs");
app.use(express.static("public"));
app.use(express.static(__dirname + "/public"));
app.use(express.static(__dirname + "/public/css"));
app.use("/public/css/images", express.static("./public/css/images"));
Interestingly, if I navigate to another file named home.ejs within the views directory, the CSS works perfectly fine.
I suspect that the issue lies with the subdirectory structure not being properly defined in my app.js
file using app.use. Could someone kindly shed some light on why this is happening and suggest a solution?