简体   繁体   English

无法在nodejitsu中加载资源socket.io?

[英]Failed to load resource socket.io in nodejitsu?

I'm trying to deploy a simple chat applicacion in Nodejitsu, and using socket.io. 我正在尝试在Nodejitsu中部署一个简单的聊天应用程序,并使用socket.io。

I use the application localy and it works perfectly but when I deploy to nodejitsu I get the following error in the javascript console: 我使用应用程序区域设置,并且运行良好,但是当我部署到nodejitsu时,在JavaScript控制台中收到以下错误:

Failed to load resource 无法加载资源

And the chat doesnt work. 和聊天不起作用。

I checked to the source code and clicked in the 我检查了源代码,然后单击

/socket.io/socket.io.js /socket.io/socket.io.js

and it works perfectly 而且效果很好

My package.json is: 我的package.json是:

{
  "name": "Chat_1",
  "subdomain": "Chat_1",
  "scripts": {
    "start": "node main.js"
  },
  "version": "0.0.0-4",
  "engines": {
    "node": "0.10.x"
  },
  "dependencies": {
    "socket.io": "*"
  }
}

I hope someone could help me, please! 我希望有人可以帮助我!

According to the Nodejitsu Handbook "We reroute all traffic to port 80". 根据Nodejitsu手册“我们将所有流量重新路由到端口80”。 Double check you're using port 80. 仔细检查您正在使用端口80。

server.listen(80);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM