Skip to content
This repository was archived by the owner on Sep 30, 2019. It is now read-only.

--dynamodb-port CLI arg works again - #161

Open
ScottAP108 wants to merge 1 commit into
little-bear-labs:masterfrom
ScottAP108:dynamodb-port-fix
Open

--dynamodb-port CLI arg works again#161
ScottAP108 wants to merge 1 commit into
little-bear-labs:masterfrom
ScottAP108:dynamodb-port-fix

Conversation

@ScottAP108

Copy link
Copy Markdown
  • version 0.14 of the emulator broke the use of a fixed dynamoDB port specified via CLI as --dynamodb-port. I have fixed this by restoring a missing function parameter for the port and using that when there is no custom config file.

async function deriveDynamoDBClient(
{ DynamoDB: config },
emulatorPath = process.cwd(),
port,

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was only specifying two parameters when it was actually receiving three arguments from bin/server. That third argument is the dynamodb port specified via CLI.

// start the dynamodb emulator
const dynamoEmulator = require('@conduitvc/dynamodb-emulator');
const dbPath = path.join(path.dirname(emulatorPath), '.dynamodb');
const { port } = config;

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This part of the function should not be using the config. This is for a default config, which is hardcoded in config.js as

module.exports = {
  DynamoDB: {
    emulator: true,
  },
};

So there is no port here, which means port will always be undefined. Instead, this line should be eliminated, and the port value passed in from the CLI should be used to launch the emulator.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant