Skip to content

Commit

Permalink
Fix AWS example in readme (#575)
Browse files Browse the repository at this point in the history
  • Loading branch information
jogold authored and szmarczak committed Aug 23, 2018
1 parent 8f30f1f commit 97533e5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions readme.md
Expand Up @@ -689,15 +689,15 @@ const AWS = require('aws-sdk');
const aws4 = require('aws4');
const got = require('got');

const credentials = await new AWS.CredentialProviderChain().resolvePromise();
const chain = new AWS.CredentialProviderChain();

// Create a Got instance to use relative paths and signed requests
const awsClient = got.extend({
baseUrl: 'https://<api-id>.execute-api.<api-region>.amazonaws.com/<stage>/',
hooks: {
beforeRequest: [
async options => {
await credentials.getPromise();
const credentials = await chain.resolvePromise();
aws4.sign(options, credentials);
}
]
Expand Down

0 comments on commit 97533e5

Please sign in to comment.