-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
39 lines (31 loc) · 1.14 KB
/
index.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
31
32
33
34
35
36
37
38
'use strict';
// load environment variables
const path = require('path');
const pwd = path.join(__dirname, '..', '/.env');
require('dotenv').config({path: pwd});
const seneca = require('seneca')();
const mailer = require('./lib/mailer');
// select desired transport method
//const transportMethod = process.env['SENECA_TRANSPORT_METHOD'] || 'rabbitmq';
const patternPin = 'role:mailer';
// init seneca and expose functions
seneca
//.use(transportMethod + '-transport')
//.client({type: 'tcp', port: 7010, host: 'localhost', pin: 'role:reporter'})
.add(patternPin + ',cmd:send,subject:pwforget,', mailer.sendPwForgottenMail)
.add(patternPin + ',cmd:send,subject:generic,', mailer.sendGenericMail)
/* .act({
role: 'mailer',
cmd: 'send',
subject: 'pwforget',
data: {
mail: '[email protected]',
new_password: 'Steffen'
}
}, (err, data) => {
console.log('Response from mailer');
console.log(err, data);
})*/
//.listen({type: 'tcp', port: 7005, pin: patternPin})
.use('mesh', {auto: true, pin: patternPin});
//.wrap(patternPin, util.reporter.report);