-
Notifications
You must be signed in to change notification settings - Fork 1
/
listen.js
30 lines (22 loc) · 606 Bytes
/
listen.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
* boltbus
* https://github.com/ryanfitz/boltbus
*
* Copyright (c) 2013 Ryan Fitzgerald
* Licensed under the MIT license.
*/
'use strict';
var boltbus = require('../lib/boltbus'),
AWS = require('aws-sdk');
AWS.config.loadFromPath(process.env.HOME + '/.ec2/credentials.json');
var bus = boltbus('listenApp', AWS);
bus.on('error', function (err) {
console.log('error', err);
});
bus.on('connection', function () {
console.log('Listen example connected');
});
bus.on('user:created', function (data) {
console.log('list app received event user:created', data);
});
bus.connect();