Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
let moduleExports = function (app: App) {
let Model = createModel(app);
let paginate = app.get('paginate');
// !code: func_init // !end
let options = {
Model,
paginate,
// !code: options_more // !end
};
// !code: options_change // !end
// Initialize our service with any options it requires
// ! code: extend
app.use('/nedb-1', createService(options));
// !end
// Get our initialized service so that we can register hooks
const service = app.service('nedb-1');
service.hooks(hooks);
// !code: func_return // !end
};
let moduleExports = function (app: App) {
let Model = createModel(app);
let paginate = app.get('paginate');
// !code: func_init // !end
let options = {
Model,
paginate,
// !code: options_more // !end
};
// !code: options_change // !end
// Initialize our service with any options it requires
app.use('/users-1', createService(options));
// Get our initialized service so that we can register hooks
const service = app.service('users-1');
service.hooks(hooks);
// !code: func_return // !end
};
let moduleExports = function (app: App) {
let Model = createModel(app);
let paginate = app.get('paginate');
// !code: func_init // !end
let options = {
Model,
paginate,
// !code: options_more // !end
};
// !code: options_change // !end
// Initialize our service with any options it requires
// ! code: extend
app.use('/nedb-2', createService(options));
// !end
// Get our initialized service so that we can register hooks
const service = app.service('nedb-2');
service.hooks(hooks);
// !code: func_return // !end
};
let moduleExports = function (app: App) {
let Model = createModel(app);
let paginate = app.get('paginate');
// !code: func_init // !end
let options = {
Model,
paginate,
// !code: options_more // !end
};
// !code: options_change // !end
// Initialize our service with any options it requires
app.use('/nedb-2', createService(options));
// Get our initialized service so that we can register hooks
const service = app.service('nedb-2');
service.hooks(hooks);
// !code: func_return // !end
};
let moduleExports = function (app: App) {
let Model = createModel(app);
let paginate = app.get('paginate');
// !code: func_init // !end
let options = {
Model,
paginate,
// !code: options_more // !end
};
// !code: options_change // !end
// Initialize our service with any options it requires
// ! code: extend
app.use('/users-1', createService(options));
// !end
// Get our initialized service so that we can register hooks
const service = app.service('users-1');
service.hooks(hooks);
// !code: func_return // !end
};
export default function(){
const app = this;
mongoose.connect(app.get('mongodb'));
let options = {
Model: User,
paginate: {
default: 5,
max: 25
}
};
app.use('/v1/users', service(options));
// const service = this.service('v1/users');
/* * * Before hooks * * */
// service.before({
// all: [hooks.requireAuthForPrivate()],
// before: [hooks.setUserID()]
// });
// /* * * After hooks * * */
// service.after({
// all: [hooks.removeSomeField()]
// });
// /* * * Set up event filters * * */
// service.created = service.updated = service.patched = service.removed = events.requireAuthForPrivate;
let moduleExports = function (app: App) {
let Model = createModel(app);
let paginate = app.get('paginate');
// !code: func_init // !end
let options = {
Model,
paginate,
// !code: options_more // !end
};
// !code: options_change // !end
// Initialize our service with any options it requires
app.use('/teams', createService(options));
// Get our initialized service so that we can register hooks
const service = app.service('teams');
service.hooks(hooks);
// !code: func_return // !end
};
let moduleExports = function (app: App) {
let Model = createModel(app);
let paginate = app.get('paginate');
// !code: func_init // !end
let options = {
Model,
paginate,
// !code: options_more // !end
};
// !code: options_change // !end
// Initialize our service with any options it requires
app.use('/roles', createService(options));
// Get our initialized service so that we can register hooks
const service = app.service('roles');
service.hooks(hooks);
// !code: func_return // !end
};
let moduleExports = function (app: App) {
let Model = createModel(app);
let paginate = app.get('paginate');
// !code: func_init // !end
let options = {
Model,
paginate,
// !code: options_more // !end
};
// !code: options_change // !end
// Initialize our service with any options it requires
app.use('/users', createService(options));
// Get our initialized service so that we can register hooks
const service = app.service('users');
service.hooks(hooks);
// !code: func_return // !end
};
let moduleExports = function (app: App) {
let Model = createModel(app);
let paginate = app.get('paginate');
// !code: func_init // !end
let options = {
Model,
paginate,
// !code: options_more // !end
};
// !code: options_change // !end
// Initialize our service with any options it requires
app.use('/roles', createService(options));
// Get our initialized service so that we can register hooks
const service = app.service('roles');
service.hooks(hooks);
// !code: func_return // !end
};