-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.js
31 lines (28 loc) · 804 Bytes
/
app.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
'use strict';
const symfode = require('symfode');
symfode.init(__dirname, [
'src'
], {
'create-user': (defer, worker, command) => {
if (command.args.username && command.args.password) {
let data = {
username: command.args.username,
password: command.args.password,
name: 'Super Admin',
roles: 'ROLE_SUPER_ADMIN',
location: 'Jakku'
};
worker.services.user.createUser(data).then(() => {
defer.resolve();
}, (err) => {
defer.reject(err);
});
} else {
defer.reject('Invalid command arguments.');
}
}
}, {
enableSessions: true,
enableWebsockets: true,
enableRedis: false
});