serverless-dynamodb-local
Advanced tools
Comparing version 0.2.17 to 0.2.18
13
index.js
@@ -116,2 +116,3 @@ 'use strict'; | ||
'dynamodb:start:startHandler': this.startHandler.bind(this), | ||
'before:offline:start': this.startHandler.bind(this), | ||
}; | ||
@@ -141,4 +142,6 @@ } | ||
dynamoOptions = { | ||
endpoint: 'http://localhost:' + port, | ||
region: 'localhost' | ||
endpoint: 'http://localhost:' + port, | ||
region: 'localhost', | ||
accessKeyId: 'MOCK_ACCESS_KEY_ID', | ||
secretAccessKey: 'MOCK_SECRET_ACCESS_KEY' | ||
}; | ||
@@ -172,3 +175,3 @@ } | ||
return new BbPromise(function(resolve, reject) { | ||
let dynamodb = self.dynamodbOptions(options.stage, options.region), | ||
let dynamodb = self.dynamodbOptions(options.region), | ||
tableOptions = self.tableOptions(); | ||
@@ -187,3 +190,3 @@ dynamodbMigrations.init(dynamodb, tableOptions.path); | ||
let dynamodb = self.dynamodbOptions(region), | ||
tableOptions = self.tableOptions(options.stage); | ||
tableOptions = self.tableOptions(); | ||
dynamodbMigrations.init(dynamodb, tableOptions.path); | ||
@@ -232,2 +235,2 @@ dynamodbMigrations.executeAll(tableOptions).then(resolve, reject); | ||
} | ||
module.exports = ServerlessDynamodbLocal; | ||
module.exports = ServerlessDynamodbLocal; |
{ | ||
"name": "serverless-dynamodb-local", | ||
"version": "0.2.17", | ||
"version": "0.2.18", | ||
"engines": { | ||
@@ -34,15 +34,9 @@ "node": ">=4.0" | ||
}, | ||
"devDependencies": { | ||
"chai": "^3.2.0", | ||
"mocha": "^2.2.5" | ||
}, | ||
"dependencies": { | ||
"aws-sdk": "^2.3.19", | ||
"bluebird": "^3.0.6", | ||
"dynamodb-localhost": "0.0.2", | ||
"dynamodb-migrations": "0.0.9", | ||
"lodash": "^4.13.1", | ||
"mkdirp": "^0.5.0", | ||
"tar": "^2.0.0" | ||
"aws-sdk": "^2.7.0", | ||
"bluebird": "^3.4.6", | ||
"dynamodb-localhost": "^0.0.5", | ||
"dynamodb-migrations": "^0.0.10", | ||
"lodash": "^4.17.0" | ||
} | ||
} |
@@ -41,3 +41,3 @@ serverless-dynamodb-local | ||
* Execute all migrations for DynamoDB Local. | ||
* Execute all migrations on the remote dynamodb. | ||
`sls dynamodb executeAll` | ||
@@ -66,3 +66,3 @@ | ||
All the above options can be added to serverless.yml to set default configuration: e.g | ||
All the above options can be added to serverless.yml to set default configuration: e.g. | ||
@@ -187,2 +187,19 @@ ```yml | ||
The `serverless dynamodb start` command can be triggered automatically when using `serverless-offline` plugin. | ||
Please note that you still need to install DynamoDB Local first. | ||
Add both plugins to your `serverless.yml` file: | ||
```yaml | ||
plugins: | ||
- serverless-dynamodb-local | ||
- serverless-offline | ||
``` | ||
Make sure that `serverless-dynamodb-local` is above `serverless-offline` so it will be loaded earlier. | ||
Now your local DynamoDB database will be automatically started before running `serverless offline`. | ||
## Reference Project | ||
* [serverless-react-boilerplate](https://github.com/99xt/serverless-react-boilerplate) | ||
## Links | ||
@@ -189,0 +206,0 @@ * [Dynamodb local documentation](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/DynamoDBLocal.html) |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
23958
5
0
8
220
209
+ Addedcall-bind-apply-helpers@1.0.1(transitive)
+ Addeddynamodb-localhost@0.0.5(transitive)
+ Addeddynamodb-migrations@0.0.10(transitive)
+ Addedfor-each@0.3.4(transitive)
- Removedmkdirp@^0.5.0
- Removedtar@^2.0.0
- Removedcall-bind-apply-helpers@1.0.2(transitive)
- Removeddynamodb-localhost@0.0.2(transitive)
- Removeddynamodb-migrations@0.0.9(transitive)
- Removedfor-each@0.3.5(transitive)
Updatedaws-sdk@^2.7.0
Updatedbluebird@^3.4.6
Updateddynamodb-localhost@^0.0.5
Updateddynamodb-migrations@^0.0.10
Updatedlodash@^4.17.0