Express server fails to load css file after going to any page other than home page. If I go back to the home page and refresh, then every other page has its css correct again. Once the css is wrong, every page is wrong after that. I've been through like 15 different answers already and nothing is working. Website is vessale.com
I believe my routes are correct, and yes since it is on a centos server I have to use /var/www/vessale.com
here is the server code:
app.use(express.static('/var/www/vessale.com' + '/client/build'));
app.use(express.static('/var/www/vessale.com' + '/client/public'));
app.use(express.static('/var/www/vessale.com' + '/client/src'));
app.use(express.static('/var/www/vessale.com/uploads'));
app.use(express.static('/var/www/vessale.com/client/src/App.css'));
app.use(express.static('/var/www/vessale.com/client/src/styles.css'));
app.get('*', (req, res) => {
res.sendFile(path.resolve('/var/www/vessale.com', 'client', 'build', 'index.html'));
});
I'm aware I don't need all of the static files. That's purely for debugging this issue and I never removed them.
and the /public/index.html
<link rel="stylesheet" type="text/css" href="../src/App.css" >
<link rel="stylesheet" type="text/css" href="../src/styles.css" >
<link rel="stylesheet" type="text/css" href="../src/styles.scss">
I'm also receiving this error for all three css files
Resource interpreted as Stylesheet but transferred with MIME type text/html: "https://vessale.com/src/styles.css".