拒绝应用'http:// localhost:3000 / css / style.css'中的样式,因为它的MIME类型('text / html')不支持

时间:2019-05-17 21:26:03

标签: node.js

我有一个app.js文件,其中包含视图/部分视图和公共文件夹,其中保存了我的静态资产。当我运行服务器时,我的主要css文件不适用,但是我在同一公用文件夹中还有另外2个css似乎生效

   Here is my header
      <html lang="en">
      <head>
      <meta charset="UTF-8" />
      <meta name="viewport" content="width=device-width, initial- 
      scale=1.0" 
      />
      <meta http-equiv="X-UA-Compatible" content="ie=edge" />
      <link rel="stylesheet" href="/css/style.css" />
    <link
      rel="stylesheet"
      media="screen and (max-width: 768px)"
      href="/css/mobile.css"
      />
     <link
     rel="stylesheet"
     media="screen and (min-width: 1100px)"
   href="/css/widescreen.css"
  />

    <link
     rel="stylesheet"
    href="https://use.fontawesome.com/releases/v5.8.1/css/all.css"
    integrity="sha384- 
    50oBUHEmvpQ+1lW4y57PTFmhCaXp0ML5d60M1M7uH2+nqUivzIebhndOJK28anvf"
    crossorigin="anonymous"
    />

  

app.use(express.static(path.join(__dirname, "/public")));

0 个答案:

没有答案