-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.js
34 lines (30 loc) · 1.13 KB
/
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
31
32
33
34
module.exports = function (sails) {
var loader = require('sails-util-mvcsloader')(sails);
// Load policies and config from default directories
loader.configure();
/*
OR if you want to set custom path :
loader.configure({
policies: __dirname + '/api/policies', // Path to your hook's policies
config: __dirname + '/config' // Path to your hook's config
});
*/
return {
initialize: function (next) {
// Load controllers, models & services from default directories
loader.adapt(function (err) {
return next(err);
});
/*
OR if you want to set custom path :
loader.adapt({
controllers: __dirname + '/api/controllers', // Path to your hook's controllers
models: __dirname + '/api/models', // Path to your hook's models
services: __dirname + '/api/services' // Path to your hook's services
}, function (err) {
return next(err);
});
*/
}
};
};