Angular full generator generator application not serving socket.io properly?

I ran into difficulties between two angular -fullstack applications deployed on AWS using the same setup and configuration.

It seems that socket.io-client / socket.io.js is not properly supported on one of them, despite the fact that it has the same settings.

It seems that it gets error 400 (failed request) when trying to get socket.io.js and, in turn, gets "io not defined".

I narrowed it down to this part of the code:

var socketio = require('socket.io')(server, {
  serveClient: (config.env === 'production') ? false : true,
  path: '/socket.io-client'
});

It seems like if I set that serveClient will always be true, it will work because it always serves the client.

If so, why do so many resources on the network set serveClient to false for production? It works only for one application, but not for another.

EDIT: just deployed to AWS with serveClient: true. Does not work. But apparently this works on my local ones.

EDIT 2: performed npm installfor a working application, now it is broken, so maybe something is broken by the packages.

EDIT 3: performed a test for NODE_ENV=productionafter grunt build:distthe same problem, so it should be released with one of the packages.

+4
source share
1 answer

angular -fullstack, grunt, bower.json( wiredep), google-code-prettify/bin/prettify.min.js, .

- prettify.min.js( ).

wiredep.target.exclude, google-code-prettyify/**/. js /src/prettify.js.

, preptify Google- , , JSHint .

, , npm - .

+4

All Articles