This repository was archived by the owner on Mar 13, 2025. It is now read-only.
File tree 2 files changed +22
-7
lines changed
2 files changed +22
-7
lines changed Original file line number Diff line number Diff line change @@ -25,9 +25,9 @@ module.exports = {
25
25
}
26
26
} ,
27
27
DYNAMODB : {
28
- AWS_ACCESS_KEY_ID : process . env . AWS_ACCESS_KEY_ID || '' ,
29
- AWS_SECRET_ACCESS_KEY : process . env . AWS_SECRET_ACCESS_KEY || '' ,
28
+ // AWS_ACCESS_KEY_ID: process.env.AWS_ACCESS_KEY_ID || '',
29
+ // AWS_SECRET_ACCESS_KEY: process.env.AWS_SECRET_ACCESS_KEY || '',
30
30
AWS_REGION : process . env . AWS_REGION || '' ,
31
- IS_LOCAL : process . env . IS_LOCAL || 'false'
31
+ IS_LOCAL : process . env . IS_LOCAL === 'true' || 'false'
32
32
}
33
33
} ;
Original file line number Diff line number Diff line change 13
13
const config = require ( 'config' ) ;
14
14
const dynamoose = require ( 'dynamoose' ) ;
15
15
16
- dynamoose . AWS . config . update ( {
16
+
17
+ const awsConfigs = config . DYNAMODB . IS_LOCAL_DB ? {
17
18
accessKeyId : config . DYNAMODB . AWS_ACCESS_KEY_ID ,
18
19
secretAccessKey : config . DYNAMODB . AWS_SECRET_ACCESS_KEY ,
19
20
region : config . DYNAMODB . AWS_REGION
20
- } ) ;
21
+ } : {
22
+ region : config . DYNAMODB . AWS_REGION
23
+ } ;
21
24
22
- if ( config . DYNAMODB . IS_LOCAL === 'true' ) {
23
- dynamoose . local ( ) ;
25
+ dynamoose . AWS . config . update ( awsConfigs ) ;
26
+
27
+ if ( config . DYNAMODB . IS_LOCAL_DB ) {
28
+ dynamoose . local ( config . DYNAMODB . DYNAMODB_URL ) ;
24
29
}
25
30
31
+ // dynamoose.AWS.config.update({
32
+ // // accessKeyId: config.DYNAMODB.AWS_ACCESS_KEY_ID,
33
+ // // secretAccessKey: config.DYNAMODB.AWS_SECRET_ACCESS_KEY,
34
+ // region: config.DYNAMODB.AWS_REGION
35
+ // });
36
+
37
+ // if (config.DYNAMODB.IS_LOCAL === 'true') {
38
+ // dynamoose.local();
39
+ // }
40
+
26
41
dynamoose . setDefaults ( {
27
42
create : false ,
28
43
update : false
You can’t perform that action at this time.
0 commit comments