loopback-component-crud v1.7.1
loopback-component-crud
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-crudUsage
Follow these steps to add CRUD extension to your loopback4 application:
Add
CRUDComponentto your application (bindmodel-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)
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
6 years ago
6 years ago
6 years ago