1.7.1 • Published 2 years ago

loopback-component-crud v1.7.1

Weekly downloads
6
License
MIT
Repository
github
Last release
2 years ago

loopback-component-crud

checks npm latest npm next license FOSSA Status

Creating CRUD endpoints in any application is a repetitive and futile task.

Using this extension you can generate a configurable CRUD endpoints with these features:

  • Authentication
  • Authorization
  • Validation
  • Nested Create
  • Nested Update

Installation

Use the package manager npm to install loopback-component-crud.

npm i --save loopback-component-crud

Usage

Follow these steps to add CRUD extension to your loopback4 application:

  • Add CRUDComponent to your application (bind model-api-builder)

    // application.ts
    import { CRUDComponent } from "loopback-component-crud";
    
    export class TestApplication extends BootMixin(
        ServiceMixin(RepositoryMixin(RestApplication))
    ) {
        constructor(options: ApplicationConfig = {}) {
            super(options);
    
            // Add crud component
            this.component(CRUDComponent);
        }
    }
  • Add CRUD config files to src/model-endpoints

    // src/model-endpoints/mymodel.rest-config.ts
    import { CRUDApiConfig } from "loopback-component-crud";
    import { MyModel } from "../models";
    
    module.exports = {
        model: MyModel,
        pattern: "CRUD",
        dataSource: "MyDataSource",
        basePath: "/mymodel",
        create: {},
        read: {},
        update: {},
        delete: {},
    } as CRUDApiConfig;

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

This project is licensed under the MIT.
Copyright (c) KoLiBer (koliberr136a1@gmail.com)

FOSSA Status

1.7.2-next.1

2 years ago

1.7.1

3 years ago

1.7.1-next.1

3 years ago

1.7.0

3 years ago

1.6.0

3 years ago

1.5.0

3 years ago

1.4.0

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago

0.11.0

4 years ago

0.10.0

4 years ago

0.9.0

4 years ago

0.8.1

4 years ago

0.6.0

4 years ago

0.5.0

4 years ago

0.3.0

4 years ago

0.2.0

4 years ago

0.1.0

4 years ago