npm.io
2.0.3 • Published 3 years ago

nest-generic-services

Licence
MIT
Version
2.0.3
Deps
11
Size
210 kB
Vulns
1
Weekly
0
DeprecatedThis package is deprecated

Nest Generic Services

Installation

This is a Node.js module available through the npm registry.

Before installing, download and install Node.js.

If this is a brand new project, make sure to create a package.json first with the npm init command.

Installation is done using the npm install command:

$ npm i nest-generic-services

Quick Start

  1. Add module in your AppModule
@Module({
  imports: [
    GenericServicesModule.register()
  ],
})
export class AppModule {
}
  1. Create a new nest project using the command nest new proyect-name.
  2. Install de library using the npm install command:
  3. Create your entities in your project and extends the class BaseEntity
export class UserEntity extends BaseEntity {
}
  1. Create your dto in your project.
  2. Create your services in your project and extends the class BaseService
export class UserService extends BaseService<UserEntity, UserDto> {
}
  1. Create your controllers in your project and extends the class CustomResponseBaseController or DefaultResponseBaseController
export class UserController1 extends CustomResponseBaseController<UserEntity, UserService, UserDto, ResponseDto> {
}
export class UserController2 extends DefaultResponseBaseController<UserEntity, UserService,UserDto> {
}

Keywords