File tree 6 files changed +22
-3
lines changed
6 files changed +22
-3
lines changed Original file line number Diff line number Diff line change @@ -9,3 +9,5 @@ yarn-error.log*
9
9
# Editor directories and files
10
10
.idea
11
11
.vscode
12
+
13
+ .env
Original file line number Diff line number Diff line change
1
+ require ( '../dotenv' ) ; // eslint-disable-line import/order
2
+
1
3
const DynamoDB = require ( 'aws-sdk/clients/dynamodb' ) ;
2
4
const { Dymon, StatsDChannel } = require ( 'dymon' ) ;
3
5
const dy2json = require ( './dy2json' ) ;
4
6
5
7
const DB = new DynamoDB ( {
6
8
apiVersion : '2012-08-10' ,
9
+ endpoint : process . env . AWS_ENDPOINT || undefined ,
7
10
credentials : {
8
- accessKeyId : 'AKIAZM7CQSNGXDQUY6PA' ,
9
- secretAccessKey : '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' ,
11
+ accessKeyId : process . env . AWS_ACCESS_KEY_ID ,
12
+ secretAccessKey : process . env . AWS_SECRET_ACCESS_KEY ,
10
13
} ,
11
- region : 'eu-central-1' ,
14
+ region : process . env . AWS_REGION ,
12
15
} ) ;
13
16
14
17
const dymon = new Dymon ( {
Original file line number Diff line number Diff line change
1
+ const path = require ( 'path' ) ;
2
+ const ENV = require ( 'dotenv' ) . config ( { path : path . resolve ( __dirname , '.env' ) } ) ;
3
+
4
+ module . exports = ENV ;
Original file line number Diff line number Diff line change
1
+ AWS_ENDPOINT = " "
2
+ AWS_REGION = " eu-central-1"
3
+ AWS_ACCESS_KEY_ID = " <YOUR_ACCESS_KEY_ID>"
4
+ AWS_SECRET_ACCESS_KEY = " <YOUR_SECRET>"
Original file line number Diff line number Diff line change 11
11
"dependencies" : {
12
12
"@koa/cors" : " ^2.2.3" ,
13
13
"aws-sdk" : " ^2.610.0" ,
14
+ "dotenv" : " ^8.2.0" ,
14
15
"dymon" : " link:./Dymon" ,
15
16
"koa" : " ^2.11.0" ,
16
17
"koa-bodyparser" : " ^4.2.1" ,
Original file line number Diff line number Diff line change @@ -463,6 +463,11 @@ doctrine@^3.0.0:
463
463
dependencies :
464
464
esutils "^2.0.2"
465
465
466
+ dotenv@^8.2.0 :
467
+ version "8.2.0"
468
+ resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.2.0.tgz#97e619259ada750eea3e4ea3e26bceea5424b16a"
469
+ integrity sha512-8sJ78ElpbDJBHNeBzUbUVLsqKdccaa/BXF1uPTw3GrvQTBgrQrtObr2mUrE38vzYd8cEv+m/JBfDLioYcfXoaw==
470
+
466
471
" dymon@link:./Dymon " :
467
472
version "0.0.0"
468
473
uid ""
You can’t perform that action at this time.
0 commit comments