forked from CoderDojo/cp-users-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathservice.js
29 lines (23 loc) · 1.1 KB
/
service.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
'use strict';
if (process.env.NEW_RELIC_ENABLED === "true") require('newrelic');
var _ =require('lodash');
var config = require('./config/config.js')();
var seneca = require('seneca')();
seneca.log.info('using config', JSON.stringify(config, null, 4));
seneca.options(config);
seneca.use('postgresql-store', config["postgresql-store"]);
if(process.env.MAILTRAP_ENABLED === 'true') {
seneca.use('mail', config.mailtrap);
} else {
seneca.use('mail', config.gmail);
}
seneca.use(require('./email-notifications.js'));
seneca.use(require('./agreements.js'));
seneca.use(require('./profiles.js'), {postgresql: config["postgresql-store"]});
seneca.use(require('./oauth2.js'), config.oauth2);
seneca.use('user');
seneca.use('auth');
seneca.use(require('./users.js'), {'email-notifications': config['email-notifications']});
seneca.listen()
.client({type: 'web', host: process.env.DOCKER_HOST_IP || process.env.TARGETIP || '127.0.0.1', port: 10304, pin: 'role:cd-salesforce,cmd:*'})
.client({type: 'web', host: process.env.DOCKER_HOST_IP || process.env.TARGETIP || '127.0.0.1', port: 10301, pin: 'role:cd-dojos,cmd:*'});