Skip to content

Commit

Permalink
Reworked endpoint logic for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
circulon committed Jul 12, 2024
1 parent 3ff604a commit e0f283b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/globals.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,9 +68,11 @@ export default class Globals {
}

public static getServiceEndpoint (service: string) {
if (!Globals.serverless.providers.aws.sdk) return null;
const config = Globals.serverless.providers.aws.sdk.config;
return config[service].endpoint || null;
if (Globals.serverless.providers.aws.sdk) {
const serviceConf = Globals.serverless.providers.aws.sdk.config[service];
return serviceConf.endpoint || null;
}
return null;
}

public static getRegion () {
Expand Down

0 comments on commit e0f283b

Please sign in to comment.