29 lines
672 B
Plaintext
29 lines
672 B
Plaintext
var pomelo = require('pomelo');
|
|
|
|
/**
|
|
* Init app for client.
|
|
*/
|
|
var app = pomelo.createApp();
|
|
app.set('name', '$');
|
|
|
|
// app configuration
|
|
app.configure('production|development', 'connector', function(){
|
|
app.set('connectorConfig',
|
|
{
|
|
connector : pomelo.connectors.sioconnector,
|
|
// 'websocket', 'polling-xhr', 'polling-jsonp', 'polling'
|
|
transports : ['websocket', 'polling'],
|
|
heartbeats : true,
|
|
closeTimeout : 60 * 1000,
|
|
heartbeatTimeout : 60 * 1000,
|
|
heartbeatInterval : 25 * 1000
|
|
});
|
|
});
|
|
|
|
// start app
|
|
app.start();
|
|
|
|
process.on('uncaughtException', function (err) {
|
|
console.error(' Caught exception: ' + err.stack);
|
|
});
|