@@ -9,6 +9,7 @@ class ServerlessDynamodbLocal {
9
9
constructor ( serverless , options ) {
10
10
this . serverless = serverless ;
11
11
this . service = serverless . service ;
12
+ this . config = this . service . custom && this . service . custom . dynamodb || { } ;
12
13
this . options = options ;
13
14
this . provider = 'aws' ;
14
15
this . commands = {
@@ -86,8 +87,7 @@ class ServerlessDynamodbLocal {
86
87
87
88
dynamodbOptions ( ) {
88
89
let self = this ;
89
- let config = self . service . custom . dynamodb || { } ,
90
- port = config . start && config . start . port || 8000 ,
90
+ let port = self . config . start && self . config . start . port || 8000 ,
91
91
dynamoOptions = {
92
92
endpoint : 'http://localhost:' + port ,
93
93
region : 'localhost' ,
@@ -131,12 +131,11 @@ class ServerlessDynamodbLocal {
131
131
startHandler ( ) {
132
132
let self = this ;
133
133
return new BbPromise ( function ( resolve ) {
134
- let config = self . service . custom . dynamodb ,
135
- options = _ . merge ( {
134
+ let options = _ . merge ( {
136
135
sharedDb : self . options . sharedDb || true
137
136
} ,
138
137
self . options ,
139
- config && config . start
138
+ self . config && self . config . start
140
139
) ;
141
140
if ( options . migrate ) {
142
141
dynamodbLocal . start ( options ) ;
@@ -175,4 +174,4 @@ class ServerlessDynamodbLocal {
175
174
} ) ;
176
175
}
177
176
}
178
- module . exports = ServerlessDynamodbLocal ;
177
+ module . exports = ServerlessDynamodbLocal ;
0 commit comments