app.js.sio.wss 546 B

12345678910111213141516171819202122232425
  1. var fs = require('fs');
  2. var pomelo = require('pomelo');
  3. /**
  4. * Init app for client.
  5. */
  6. var app = pomelo.createApp();
  7. app.set('name', '$');
  8. // app configuration
  9. app.configure('production|development', function(){
  10. app.set('connectorConfig',
  11. {
  12. connector : pomelo.connectors.sioconnector,
  13. key: fs.readFileSync('../shared/server.key'),
  14. cert: fs.readFileSync('../shared/server.crt')
  15. });
  16. });
  17. // start app
  18. app.start();
  19. process.on('uncaughtException', function (err) {
  20. console.error(' Caught exception: ' + err.stack);
  21. });