Skip to content

Introduce method exclusion/inclusion

Compare
Choose a tag to compare
@twof twof released this 26 Oct 20:29
· 64 commits to master since this release
5e243fe

Including or Excluding Specific Routes

If you'd like to register a Model, but you don't want every route to be available, you can specify the ones you want, or exclude the ones you don't.

try router.crud(register: Todo.self, .except([.create, .delete])) { controller in
    try controller.crud(parent: \.owner, .only([.read]))
}

results in

PUT /todo/int
GET /todo/int
GET /todo

GET /todo/int/tag/int