3

我正在尝试使用 npm lib dynamo-client 连接到我的 dynamodb 本地。我按照以下方式安装和运行本地 dynamodb 客户端:http: //aws.typepad.com/aws/2013/09/dynamodb-local-for-desktop-development.html

但是尝试使用以下方式连接到我的本地主机:

db = dynamo.createClient('localhost', dbConf.credentials)
db.request('ListTables','', (e,r) -> console.log(e))

给出以下错误:

e: {"code":"ECONNREFUSED","errno":"ECONNREFUSED","syscall":"connect"}
4

1 回答 1

2

需要在选项中设置端口和主机:

dbConf =
  region:
    region: 'localhost'
    host: 'localhost'
    port: 8000
  credentials:
    secretAccessKey: "KEY"
    accessKeyId: "ACCESSKEY"

db = dynamo.createClient(dbConf, dbConf.credentials)
于 2015-11-20T05:30:55.833 回答