As mentionned in comments: you need a way to send your static files to the client. This can be achieved with a reverse proxy like Nginx, or simply using express.static().
Put all your static (css, js, images) files in a folder dedicated to it, different from where you put your views (html files in your case). Ill call it
static for the example. Once its done, add this line in your server code:
This will effectively serve every file in your static folder via the /static route.
Querying your index.js file in the client thus becomes:
I had a similar issue that was resolved by omitting the leading slashes in my code. E.g. replace