I'm using express and node. In my server.js
file I have this piece of code:
app.use(express.static('/static'));
And subsequently in my static directory, I have a CSS folder, and then a style.css
file. In my index.html
, I link to the sheet like so:
<link rel="stylesheet" type="text/css" href="/static/css/style.css">
However, in my local host I continue to get this error:
Refused to apply style from 'http://localhost:3500/static/css/style.css' because its MIME type ('text/html') is not a supported stylesheet MIME type, and strict MIME checking is enabled.
I am sure that my path name in my tag is right, and I'm confused to why I'm getting this error. Do I need to declare that CSS files be processed as CSS and not HTML? Am I not doing that when I say type="text/CSS"
? If not, what do I need to put into my server file to remedy this issue?