Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify mockbin script to use env vars or custom npm config #57

Merged
merged 1 commit into from
Nov 20, 2016
Merged

Modify mockbin script to use env vars or custom npm config #57

merged 1 commit into from
Nov 20, 2016

Conversation

marcel-dias
Copy link
Contributor

What ?

I'm proposing a modification in the ./bin/mockbin script to read the startup params from Environment Variables or from the npm config properties. Now it is correct reading the customized values.

Example:
If you set the port to 8001 with npm config set mockbin:port 8001 the server will listen the 8001 instead of 8080

Why ?

I was trying to use the docker image, but mockbin was not able to connect to redis instance. This happens because the bin/mockbin reads the config from pkg.config.* and this properties always have the default values from package.json.
So I modified it to read from process.env.npm_package_config_redis then the custom config npm config set mockbin:redis redis://redis:6379 will work properly.

Probably fix #48

@ahmadnassri
Copy link
Contributor

good job, thanks!

will review and release after I fix the travis build ..

@ahmadnassri ahmadnassri merged commit 1b3966b into Kong:master Nov 20, 2016
@marcel-dias marcel-dias deleted the mockbin-options branch November 25, 2016 18:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants