resource static method
Implementation
static RouteGroupDefinition resource(String resource, Type controller,
{String? parameterName}) {
resource = resource.toLowerCase();
final resourceId =
'${(parameterName ?? resource).toSingular().toLowerCase()}Id';
return Route.group(resource, [
Route.get('/', (controller, #index)),
Route.get('/<$resourceId>', (controller, #show)),
Route.post('/', (controller, #create)),
Route.put('/<$resourceId>', (controller, #update)),
Route.patch('/<$resourceId>', (controller, #update)),
Route.delete('/<$resourceId>', (controller, #delete))
]);
}