Page Contents

Home > @loopback/rest-crud

rest-crud package

@loopback/rest-crud

Functions

| Function | Description | | — | — | | defineCrudRestController(modelCtor, options) | Create (define) a CRUD Controller class for the given model.Example usage:

const CrudRestController = defineCrudRestController<
  Product,
  typeof Product.prototype.id,
  'id'
>(Product, {basePath: '/products'});

class ProductController extends CrudRestController {
  constructor() {
   super(repo);
  }
}

app.controller(ProductController);

|

Interfaces

Interface Description
CrudRestController This interface describes prototype members of the controller class returned by defineCrudRestController.
CrudRestControllerCtor Constructor of the controller class returned by defineCrudRestController.
CrudRestControllerOptions Options to configure different aspects of a CRUD REST Controller.