Is this middleware applied to all actions?
Unique name for the middleware.
OptionalpostCalled after the action runs.
OptionalpreCalled before the action runs. Has access to all params, before sanitization. Can modify the data object for use in actions.
OptionalpriorityModule load order. Defaults to api.config.general.defaultMiddlewarePriority.
var middleware = { name: 'userId checker', global: false, priority: 1000, preProcessor: async (data) => { if(!data.params.userId){ throw new Error('All actions require a userId') } }, postProcessor: async (data) => { if(data.thing.stuff == false){ data.toRender = false } } }