1.0.1 • Published 5 years ago

nestjs-ctrip-apollo-client v1.0.1

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

NestJS CtripApolloClientModule

携程 Apollo 配置中心 NestJS 客户端,基于node-apollo-client封装。

安装

npm install nestjs-ctrip-apollo-client

使用

import { Module } from '@nestjs/common';
import { CtripApolloClientModule } from 'nestjs-ctrip-apollo-client';

@Module({
  imports: [
    CtripApolloClientModule.register({
      configServerUrl: 'http://xxx.xxx.xxx.xxx',
      appId: 'my-app',
      cluster: 'default',
      namespaces: ['application'],
      initialConfigs: {},
      listenOnNotification: true,
      fetchCacheInterval: 5 * 60e3,
      cachedConfigFilePath: '/tmp',
    }),
  ],
  providers: [],
})
export class AppModule {}