MIME type error with express.static and CSS files

前端 未结 3 1974
温柔的废话
温柔的废话 2021-01-12 05:48

I\'m using express and node. In my server.js file I have this piece of code:

app.use(express.static(\'/static\'));

And subsequ

3条回答
  •  野趣味
    野趣味 (楼主)
    2021-01-12 06:35

    I had the same error, but it was caused by a not machting case. I wrote in my HTML file:

    
    

    But the actual filename was MYSCRIPT.js. I didn't noticed that, because when I open the HTML file locally, browsers seem to ignore this and import even files where the cases not match.

提交回复
热议问题