Introduce method exclusion/inclusion
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