【发布时间】:2013-09-19 13:30:02
【问题描述】:
我是 node.js 的新手,我不明白标头是如何工作的。我试图在我的 index.html 中附加到我的项目 fancybox,但它不起作用。我正在使用 c9.io 工作区,所以它看起来像 <script src="http://space.......c9.io/jquery.fancybox-1.3.4.js"></script>
我在控制台中仍然遇到同样的错误:socket io Resource Explained as Script but transfer with MIME type text/plain:
拜托,有没有人可以尽可能简单地解释我?
我的 js 文件
var http = require("http"),
express = require('express'),
app = express(),
server = app.listen(process.env.PORT),
io = require('socket.io').listen(server)
app.get('/', function (req, res) {
res.sendfile(__dirname + '/index.html');
});
io.sockets.on('connection', function (socket) {
});
【问题讨论】:
标签: node.js types http-headers socket.io mime