{"id":17506565,"url":"https://github.com/chf007/nestjs-ctrip-apollo-client","last_synced_at":"2025-04-23T12:26:59.891Z","repository":{"id":36944151,"uuid":"232228708","full_name":"chf007/nestjs-ctrip-apollo-client","owner":"chf007","description":"Ctrip Apollo Client for Nestjs","archived":false,"fork":false,"pushed_at":"2024-02-28T06:05:47.000Z","size":531,"stargazers_count":3,"open_issues_count":14,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-29T23:41:10.457Z","etag":null,"topics":["apollo","configuration-management","ctrip-apollo-client","nestjs"],"latest_commit_sha":null,"homepage":"https://github.com/chf007/nestjs-ctrip-apollo-client","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chf007.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-07T02:45:10.000Z","updated_at":"2024-02-28T06:05:51.000Z","dependencies_parsed_at":"2025-03-05T13:36:19.556Z","dependency_job_id":"7b8eaf7f-f88f-4de3-8d06-008abea1586f","html_url":"https://github.com/chf007/nestjs-ctrip-apollo-client","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chf007%2Fnestjs-ctrip-apollo-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chf007%2Fnestjs-ctrip-apollo-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chf007%2Fnestjs-ctrip-apollo-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chf007%2Fnestjs-ctrip-apollo-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chf007","download_url":"https://codeload.github.com/chf007/nestjs-ctrip-apollo-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250432782,"owners_count":21429740,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["apollo","configuration-management","ctrip-apollo-client","nestjs"],"created_at":"2024-10-20T03:45:24.001Z","updated_at":"2025-04-23T12:26:59.856Z","avatar_url":"https://github.com/chf007.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NestJS CtripApolloClientModule\n\n携程 [Apollo 配置中心](https://github.com/ctripcorp/apollo) NestJS 客户端，基于 [node-apollo-client](https://github.com/shinux/node-apollo-client) 封装。\n\n## 安装\n\n```bash\nnpm install nestjs-ctrip-apollo-client\n```\n\n## 使用\n\n```\n// 导入 Module\nimport { Module } from '@nestjs/common';\nimport { CtripApolloClientModule } from 'nestjs-ctrip-apollo-client';\n\n@Module({\n  imports: [\n    CtripApolloClientModule.register({\n      configServerUrl: 'http://xxx.xxx.xxx.xxx',\n      appId: 'my-app',\n      cluster: 'default',\n      namespaces: ['application'],\n      initialConfigs: {},\n      listenOnNotification: true,\n      fetchCacheInterval: 5 * 60e3,\n      cachedConfigFilePath: '/tmp',\n    }),\n  ],\n  providers: [],\n})\nexport class AppModule {}\n\n// 使用 Service\nimport { Controller, Get } from '@nestjs/common';\nimport { CtripApolloClientService } from 'nestjs-ctrip-apollo-client';\n\n@Controller('api')\nexport class SomeController {\n  constructor(private readonly ctripApolloClientService: CtripApolloClientService) {}\n\n  @Get('test')\n  async test() {\n    return await this.ctripApolloClientService.fetchConfig({\n      key: 'someConfigKey'\n    });\n  }\n}\n\n```\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchf007%2Fnestjs-ctrip-apollo-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchf007%2Fnestjs-ctrip-apollo-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchf007%2Fnestjs-ctrip-apollo-client/lists"}