const express = require('express');
const bodyParser = require('body-parser');
const createClient = require('rabblerouser-stream-client');

const config = require('./config');
const sendRegistrationEmail = require('./sendRegistrationEmail')

const app = express();
app.use(bodyParser.json());

const streamClientSettings = {
  listenWithAuthToken: config.listenerAuthToken,
};
const streamClient = createClient(streamClientSettings);

streamClient.on('member-registered', member => sendRegistrationEmail(member.email));
app.post('/mail', streamClient.listen());

app.listen(3001, () => {
  console.log('Listening for events');
});

const express = require('express');
const bodyParser = require('body-parser');
const createClient = require('@rabblerouser/stream-client');

const config = require('./config');
const sendRegistrationEmail = require('./sendRegistrationEmail')

const app = express();
app.use(bodyParser.json());

const streamClientSettings = {
  listenWithAuthToken: config.listenerAuthToken,
};
const streamClient = createClient(streamClientSettings);

streamClient.on('member-registered', member => sendRegistrationEmail(member.email));
app.post('/mail', streamClient.listen());

app.listen(3001, () => {
  console.log('Listening for events');
});

Update library reference to fix last commit
Update library reference to fix last commit
