nest-microservices-common

0.0.4 • Public • Published

nest-microservices-common

  • A NestJS module for generator-nest-microservices yeoman template that offers base controller, services and repositories as well as some interceptors and filters

How to use

  • install package with npm i -S nest-microservices-common
  • Register the CommonModule to your feature modules:
@Module({})
export class AppModule {
  static register(config: ConfigOptions): DynamicModule {
    return {
      module: AppModule,
      imports: [
        CommonModule.register({ platform: CommonModulePlatform.EXPRESS }),
        ...
      ],
    };
  }
}
  • Once CommonModule is registered, then you can extend the BaseController, BaseService<T> and BaseRepository<T>
export class ExampleController extends BaseController<Example, ExampleService> {
  constructor (service: ExampleService, logger: LoggerService) {
    super (service, logger);
  }
}

/nest-microservices-common/

    Package Sidebar

    Install

    npm i nest-microservices-common

    Weekly Downloads

    0

    Version

    0.0.4

    License

    UNLICENSED

    Unpacked Size

    31.2 kB

    Total Files

    35

    Last publish

    Collaborators

    • jsnmgpnty