chiefbiiko / dynamodb

deno <3 dynamodb
MIT License
25 stars 11 forks source link

if provided, use a dynamodb host config in place of localhost #27

Closed revgum closed 3 years ago

revgum commented 3 years ago

It'd be quite handy to have the ability to specify a dynamodb host name in place of localhost, the use-case I have is running a deno app inside of a docker container that needs to connect to a local dynamodb running on the docker host machine.. so in this case I can set DYNAMODB_HOST=host.docker.internal and it'll make the connection properly.

chiefbiiko commented 3 years ago

cool, thanks a lot for bringing up this issue! instead of using that DYNAMODB_HOST env var could you add a host prop to ClientConfig and then pass it to and use it in deriveConfig / deriveHostEndpoint that way, ClientConfig surfaced with createClient will remain the primary touch point for client configuration

revgum commented 3 years ago

Good call for sure. I reworked the implementation and added coverage.

chiefbiiko commented 3 years ago

thanks a lot!