Skip to content

Commit

Permalink
further config refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
michavie committed Jan 9, 2024
1 parent f9e3f0a commit 5b86372
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions libs/common/src/config/app.config.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,7 @@ export class AppConfigService {
constructor(private readonly configService: ConfigService) {}

get apiUrl(): string {
const apiUrl = this.configService.get<string>('services.chain.apiUrl')
if (!apiUrl) {
throw new Error('No api url present')
}

return apiUrl
return this.configService.getOrThrow<string>('services.chain.apiUrl')
}

get networkProvider(): ApiNetworkProvider {
Expand All @@ -22,12 +17,7 @@ export class AppConfigService {
}

get swaggerUrls(): string[] {
const swaggerUrls = this.configService.get<string[]>('services.swagger.urls')
if (!swaggerUrls) {
throw new Error('No swagger urls present')
}

return swaggerUrls
return this.configService.getOrThrow<string[]>('services.swagger.urls')
}

get redisUrl(): string {
Expand Down

0 comments on commit 5b86372

Please sign in to comment.