Skip to content

Instantly share code, notes, and snippets.

@khalidx
Created August 2, 2019 02:28
Show Gist options
  • Save khalidx/b0661623224333f7bd14451b1cf05c3b to your computer and use it in GitHub Desktop.
Save khalidx/b0661623224333f7bd14451b1cf05c3b to your computer and use it in GitHub Desktop.
DynamoDb utility for usage in TypeScript with serverless-offline
import AWS from 'aws-sdk'
export default (process.env.IS_OFFLINE)
? new AWS.DynamoDB.DocumentClient({
region: 'localhost',
endpoint: 'http://localhost:8000',
accessKeyId: 'NONE',
secretAccessKey: 'NONE'
})
: new AWS.DynamoDB.DocumentClient()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment