mirror of
https://github.com/amark/gun.git
synced 2025-03-30 15:08:33 +00:00
Correctly referring to process.env.AWS_REGION and initializing Store with s3 if opts.s3 has been configured. (#1064)
This commit is contained in:
parent
4dc672eeb4
commit
4a84984699
@ -20,7 +20,7 @@ Gun.on('create', function(root){
|
||||
|
||||
var opts = opt.s3 || (opt.s3 = {});
|
||||
opts.bucket = opts.bucket || process.env.AWS_S3_BUCKET;
|
||||
opts.region = opts.region || process.AWS_REGION || "us-east-1";
|
||||
opts.region = opts.region || process.env.AWS_REGION || "us-east-1";
|
||||
opts.accessKeyId = opts.key = opts.key || opts.accessKeyId || process.env.AWS_ACCESS_KEY_ID;
|
||||
opts.secretAccessKey = opts.secret = opts.secret || opts.secretAccessKey || process.env.AWS_SECRET_ACCESS_KEY;
|
||||
|
||||
@ -33,7 +33,7 @@ Gun.on('create', function(root){
|
||||
opts.config = new AWS.Config(opts);
|
||||
opts.s3 = opts.s3 || new AWS.S3(opts.config);
|
||||
|
||||
opt.store = opt.store || Store(opt);
|
||||
opt.store = Object.keys(opts.s3).length === 0 ? opt.store : Store(opt);
|
||||
});
|
||||
|
||||
function Store(opt){
|
||||
|
Loading…
x
Reference in New Issue
Block a user