-
Notifications
You must be signed in to change notification settings - Fork 23
/
app.js
44 lines (33 loc) · 956 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
32
33
34
35
36
37
38
39
40
41
42
43
44
'use strict';
/*
* Defining the Package
*/
var mean = require('meanio'),
Module = mean.Module;
function MeanUserKlass () {
Module.call(this, 'users');
this.auth = null;
}
MeanUserKlass.prototype = Object.create(Module.prototype,{constructor:{
value:MeanUserKlass,
configurable: false,
enumerable: false,
writable: false
}});
var MeanUser = new MeanUserKlass();
/*
* All MEAN packages require registration
* Dependency injection is used to define required modules
*/
MeanUser.register(function(app, database, passport) {
MeanUser.auth = require('./authorization');
require('./passport')(passport);
mean.register('auth', MeanUser.auth);
//We enable routing. By default the Package Object is passed to the routes
MeanUser.routes(app, MeanUser.auth, database, passport);
MeanUser.angularDependencies(['angular-jwt']);
MeanUser.events.defaultData({
type: 'user'
});
return MeanUser;
});