2.0.3 • Published 9 months ago
nest-generic-services v2.0.3
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
- Add module in your AppModule
@Module({
imports: [
GenericServicesModule.register()
],
})
export class AppModule {
}
- Create a new nest project using the command
nest new proyect-name
. - Install de library using the
npm install
command: - Create your entities in your project and extends the class BaseEntity
export class UserEntity extends BaseEntity {
}
- Create your dto in your project.
- Create your services in your project and extends the class BaseService
export class UserService extends BaseService<UserEntity, UserDto> {
}
- 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> {
}