我想知道如何在使用 sequelize 数据库适配器(或任何其他适配器)时从服务中删除一些服务方法(端点)
// Initializes the `society` service on path `/society`
const createService = require('feathers-sequelize');
const createModel = require('../../models/society.model');
const hooks = require('./society.hooks');
module.exports = function (app) {
const Model = createModel(app);
const paginate = app.get('paginate');
const options = {
name: 'society',
Model,
paginate
};
// Initialize our service with any options it requires
app.use('/societies', createService(options));
// Get our initialized service so that we can register hooks and filters
const service = app.service('societies');
service.hooks(hooks);
};
在这里,所有服务方法:get,patch,post,remove
都可用 - 我只想拥有get
和find
一种方法是使用钩子停止请求,但这是一种肮脏的方式。