Skip to content

@alejandro /log.bash secret
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
# if i don't parseInt the app_port var i get this
> app_port=2131 node server
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Object 2131 has no method 'on'
at new Manager (/home/alejandromg/9539-92fd447a71e931bda296344ae90b9f48/node_modules/socket.io/lib/manager.js:101:10)
at Object.listen (/home/alejandromg/9539-92fd447a71e931bda296344ae90b9f48/node_modules/socket.io/lib/socket.io.js:71:10)
at Object.<anonymous> (/home/alejandromg/9539-92fd447a71e931bda296344ae90b9f48/server.js:4:31)
at Module._compile (module.js:441:26)
at Object..js (module.js:459:10)
at Module.load (module.js:348:31)
at Function._load (module.js:308:12)
at Array.0 (module.js:479:10)
at EventEmitter._tickCallback (node.js:192:40)
// this works
var PORT = parseInt(process.env['app_port'],10) || 3000;
var io = require("socket.io").listen( PORT, function(){
io.sockets.on("connection",arrancar);
function arrancar(msg){
msg.on("nuevoMensaje",emitir);
}
function emitir(data){
io.sockets.emit("mensaje",data);
}
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.