app.js.mqtt 545 B

123456789101112131415161718192021222324
  1. var pomelo = require('pomelo');
  2. /**
  3. * Init app for client.
  4. */
  5. var app = pomelo.createApp();
  6. app.set('name', '$');
  7. // app configuration
  8. app.configure('production|development', 'connector', function(){
  9. app.set('connectorConfig',
  10. {
  11. connector : pomelo.connectors.mqttconnector,
  12. publishRoute: 'connector.entryHandler.publish',
  13. subscribeRoute: 'connector.entryHandler.subscribe'
  14. });
  15. });
  16. // start app
  17. app.start();
  18. process.on('uncaughtException', function (err) {
  19. console.error(' Caught exception: ' + err.stack);
  20. });