stylesheet not loaded because of mime-type
put your .css file in a folder called public
in your app.js file add the following code:
app.use(express.static('public'));
stylesheet not loaded because of mime-type
put your .css file in a folder called public
in your app.js file add the following code:
app.use(express.static('public'));
Refused to apply style from 'http://localhost:9000/public/css/style.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
For me the solution was: instead, app.use(express.static(__dirname + '/public'));
I have used: app.use(express.static(__dirname));
now everything working correctly
Refused to apply style from 'http://localhost:3000/css/styles.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
app.get('/style.css', function(req, res) {
res.sendFile(__dirname + "/" + "style.css");
});
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us