Crud module automatically generate create update get delete methods on given controller


npm i @appolo/crud

in config/modules/all.ts

import {Crud} from '@appolo/crud';
export = async function (app: App) {
app.module.use( Crud);


create a controller with given entity and inject handle manager that implements IBaseCrudManager

import {CrudController,crud} from '@appolo/crud';
@crud({model: Test})
export class TestController extends CrudController<Test> {
@inject(TestManager) manager: TestManager

now define the entity

export class Test {
id: string;
name: string;
isActive: boolean;

this will create the following end points

  • GET /test/ - get all entities
  • GET /test/:id - get one entity
  • POST /test/ - create entity
  • PATCH /test/:id - update entity
  • DELETE /test/:id - delete entity
  • PATCH /test/:id/active - active entity