当我在本地主机上运行我的应用程序时,出现了2条有关MIME类型的警告。这就是其中之一:使用Meteor更改MIME类型
Resource interpreted as Stylesheet but transferred with MIME type text/html: "http://localhost:3000/BootstrapEssentials/bootstrap.css".
另一个警告是使用不同的文件相同。这两个文件都在我的工作目录中。到目前为止,我已经对这些类似的问题,但他们并没有帮助:
Chrome says "Resource interpreted as script but transferred with MIME type text/plain.", what gives?
Resource interpreted as stylesheet but transferred with MIME type text/html
本来我是想用这条线:
<link rel="stylesheet" href="/BootstrapEssentials/bootstrap.css">
我已经加入类型字段:
<link rel="stylesheet" href="/BootstrapEssentials/bootstrap.css" type="text/css">
但这并没有做任何事。我也使用JavaScript控制台在响应头中看到它有content-type: text/html; charset=utf-8
,我相信如果我可以将其更改为content-type: text/css; charset=utf-8
,那么一切都会很好,但我无法找到如何做到这一点。
BootstrapEssentials文件夹位于名为public的目录中吗? – sheeldotme
@sheeldotme不,应该是?我目前已将它放在我的client.js文件旁边的客户端文件夹中。 –