-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.js
30 lines (28 loc) · 982 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
const _ = require('lodash');
var configService = require('../../../api/services/ConfigService.js');
module.exports = function (sails) {
return {
initialize: function (cb) {
sails.log.verbose('PDF SERVICE INITIALISING');
// Do Some initialisation tasks
let PDFService = null;
if (!_.isEmpty(configService) && _.isFunction(configService.mergeHookConfig)) {
configService.mergeHookConfig('@researchdatabox/sails-hook-redbox-pdfgen', sails.config);
PDFService = sails.services['pdfservice'];
} else {
sails.log.warn("Warning PDF Plugin in compatibility mode.");
PDFService = require('./api/services/PDFService');
sails.services['pdfservice'] = PDFService;
}
sails.log.verbose(PDFService);
return cb();
},
//If each route middleware do not exist sails.lift will fail during hook.load()
routes: {
before: {},
after: {}
},
configure: function () {
}
}
};