I have a query regarding setting up custom folders in Express.js
Here's my situation: I need to implement logic where if a specific name is present in my database, the paths for CSS and JS files should be altered before rendering.
By default, my path in Express is set as:
app.use(express.static(path.join(__dirname, 'public')));
However, when the user "spartan" is called, the main CSS path under public should change to /spartan/css/file.xyz
In this snippet from my Handlebars template, I tried implementing it like this:
{{#each site.cssFiles}}
<link rel="stylesheet" href="{{site.name}}/css/{{this}}.css" />
{{/each}}
But the result is:
<link rel="stylesheet" href="/css/main.css">
Why is this happening? And how can I actually implement my desired logic?