1
0
Fork 0
lightspeed-watcher/dynamodb-connect.js
2018-03-08 11:25:10 -05:00

17 lines
313 B
JavaScript

const ddb = exports
const aws = require('aws-sdk')
ddb.connect = () => {
return new aws.DynamoDB.DocumentClient(options())
}
function options () {
if (process.env.DYNAMODB_ENDPOINT) {
return {
region: 'localhost',
endpoint: process.env.DYNAMODB_ENDPOINT
}
} else {
return {}
}
}