stein-orm-rest

11.4.4 • Public • Published

Example

import RestController from 'stein-orm-rest'

const customAuthorization = (req, res, next) => {
  if (!req.user.canAccessTask(req)) {
    return res.status(401).send('you cannot access this task')
  }
  return next()
};

new RestController(app, {
  auth: [customAuthorization],
  modelType: Task,
  route: '/tasks',
})

Readme

Keywords

none

Package Sidebar

Install

npm i stein-orm-rest

Weekly Downloads

34

Version

11.4.4

License

MIT

Unpacked Size

195 kB

Total Files

30

Last publish

Collaborators

  • founderlab