-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.js
More file actions
32 lines (29 loc) · 1.15 KB
/
Copy pathindex.js
File metadata and controls
32 lines (29 loc) · 1.15 KB
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
const _ = require('lodash');
const ncp = require('ncp');
const fs = require('fs-extra');
const RedcapController = require('./api/controllers/RedcapController');
const RedcapService = require('./api/services/RedcapService');
const recordTypeConfig = require('./config/recordtype.js');
const workflowConfig = require('./config/workflow.js');
const workspaceTypeConfig = require('./config/workspacetype.js');
const recordFormConfig = require('./form-config/redcap-1.0-draft.js');
module.exports = function (sails) {
return {
initialize: function (cb) {
global.ConfigService.mergeHookConfig('@researchdatabox/sails-hook-redbox-redcap', sails.config);
return cb();
},
//If each route middleware do not exist sails.lift will fail during hook.load()
routes: {
before: {},
after: {
'post /:branding/:portal/ws/redcap/project': RedcapController.project,
'post /:branding/:portal/ws/redcap/link': RedcapController.link
}
},
configure: function () {
//TODO: Maybe Temporarily commenting this out as it's not initialising correctly
sails.services['RedcapService'] = RedcapService;
}
}
};