lib/appfuel/initializers/aws_dynamodb.rb in appfuel-0.5.1 vs lib/appfuel/initializers/aws_dynamodb.rb in appfuel-0.5.2
- old
+ new
@@ -1,13 +1,13 @@
Appfuel::Initialize.define('global.aws_dynamodb') do |config, container|
require 'aws-sdk'
require 'appfuel/storage/aws_dynamodb'
env = config[:env]
- if ['local', 'development'].include?(env.to_s)
+ endpoint = config[:aws][:dynamodb][:endpoint]
+ if ['local', 'development'].include?(env.to_s) && endpoint
Aws.config.update({
- region: config[:aws][:dynamodb][:region],
- endpoint: config[:aws][:dynamodb][:endpoint]
+ endpoint: endpoint
})
end
key = Appfuel::AwsDynamodb::CLIENT_CONTAINER_KEY
client = Aws::DynamoDB::Client.new