I swapped the order of the port configuration so that it first checks to see if you've defined a port within your serverless.yml file rather than if you've passed one in via the command line.
This may or may not be an issue for people who are currently using this plugin. My line of thinking was that if they are passing a port through the command line today, it will be setting their localhost server which hosts their api gateway endpoints on the same port. (which will error) Not everyone uses API Gateway so there could be some cases out there that this doesn't apply to. If someone is running multiple dynamoDB databases and they are using the --port command line flag to specifically define a port, is there a use case where they would need to set a port within their serverless.yml file?
--port -p Port to listen on. Default: 8000. This flag is overridden by the serverless.yml custom option detailed below.
All the above options can be added to serverless.yml to set default configuration: e.g.
custom:
dynamodb:
start:
port: 8000 # This option will override the CLI option --port
inMemory: true
migrate: true
seed: true
# Uncomment only if you already have a DynamoDB running locally
# noStart: true
Todos:
[x] Write documentation
[X] Enable "Allow edits from maintainers" for this PR
[X] Update the messages below
Is this ready for review?: YES
Is it a breaking change?: MAYBE for some users.
What did you implement:
Closes: https://github.com/99xt/serverless-dynamodb-local/issues/135
How did you implement it:
I swapped the order of the port configuration so that it first checks to see if you've defined a port within your serverless.yml file rather than if you've passed one in via the command line.
This may or may not be an issue for people who are currently using this plugin. My line of thinking was that if they are passing a port through the command line today, it will be setting their localhost server which hosts their api gateway endpoints on the same port. (which will error) Not everyone uses API Gateway so there could be some cases out there that this doesn't apply to. If someone is running multiple dynamoDB databases and they are using the
--port
command line flag to specifically define a port, is there a use case where they would need to set a port within their serverless.yml file?Documentation updates pertain to: https://github.com/99xt/serverless-dynamodb-local/blob/v1/README.md#install-sls-dynamodb-install
Start: sls dynamodb start
All CLI options are optional:
All the above options can be added to serverless.yml to set default configuration: e.g.
Todos:
Is this ready for review?: YES Is it a breaking change?: MAYBE for some users.