express-crud-router
express-crud-router copied to clipboard
Adding a middleware function before sequelize call
Hi there
I was wondering if you've thought about adding an option to allow users to provide a middleware function. For instance a permission check on a given route.
import authCheck from './authCheck';
const ROLES = ['ROLE_1', 'ROLE_2']
express.Router()
.get('/some/resource', authCheck(ROLES), (req, res, next) => {})
As far as I can see there is no ability to add any validator or permission-checking middleware.
Hello @wattry. Sorry for the delay to answer. I am now maintaining this library and I share your concern. Do you have any suggestion of what the API should looks like?