浏览器客户端可以连接到doxker容器中的dynamodb
我一直在使用@aws-sdk/client-dynamodb
server-side(sveltekit/nodejs)连接到Localhost docker容器,并使用Amazon/dynamodb-local的实例:最新
效果很好。我使用AWS CLI配置表等
const client = new DynamoDBClient({ endpoint: 'http://localhost:8000' });
。 。我已经尝试通过区域:'none'
,但是后来我收到了一条消息,说凭证丢失了。添加虚拟凭据使命令可以执行,但我没有得到预期的响应。例如,发送listTablesCommand
返回一个空数组。如果我从AWS CLI中做同样的事情,我会得到正确的响应。
DynamoDB客户端是否在浏览器中运行客户端?还是我想念其他东西?
I've been using @aws-sdk/client-dynamodb
server-side (SvelteKit / NodeJS) connecting to localhost Docker container with instance of amazon/dynamodb-local:latest
which works well. I used AWS CLI to configure tables, etc. I've created the client using the simplest configuration:
const client = new DynamoDBClient({ endpoint: 'http://localhost:8000' });
This works server-side, but when the same is executed client-side along with a command, I get a message that the region is missing. I've tried passing region: 'none'
, but then I get a message that the credentials are missing. Adding dummy credentials enables the command to execute, but I don't get an expected response. For example, sending the ListTablesCommand
returns an empty array. If I do the same from the AWS CLI, I get the correct response.
Does the DynamoDB client run client-side, i.e., in the browser? Or am I missing something else?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
不,它不会在浏览器中运行,您将需要API网关和一些后端代码将浏览器连接到DynamoDB。
No it doesn't run in a browser, You will need API Gateway and some backend code to connect a browser to Dynamodb.