forked from strongloop/loopback-component-push
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.js
30 lines (24 loc) · 790 Bytes
/
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
/**
* Export the connector
*/
var PushConnector = require('./lib/push-connector');
exports = module.exports = PushConnector;
/**
* Export two model classes as properties
*/
exports.Installation = require('./models/installation');
exports.Notification = require('./models/notification');
var loopback = require('loopback');
exports.createPushModel = function (options) {
options = options || {};
var pushDataSource = loopback.createDataSource({
connector: PushConnector,
installation: options.installation,
application: options.application,
notification: options.notification
});
var PushModel = pushDataSource.createModel(options.name || 'Push', {},
{plural: options.plural || 'push'});
return PushModel;
};
exports.Push = exports.createPushModel();