我正在尝试使用npm lib dynamo-client连接到我的dynamodb本地。我按照以下方式安装并运行本地dynamodb客户端: http://aws.typepad.com/aws/2013/09/dynamodb-local-for-desktop-development.html
但是尝试使用以下方法连接到我的localhost:
db = dynamo.createClient('localhost', dbConf.credentials)
db.request('ListTables','', (e,r) -> console.log(e))
给出以下错误:
e: {"code":"ECONNREFUSED","errno":"ECONNREFUSED","syscall":"connect"}
答案 0 :(得分:2)
需要在选项中设置端口和主机:
dbConf =
region:
region: 'localhost'
host: 'localhost'
port: 8000
credentials:
secretAccessKey: "KEY"
accessKeyId: "ACCESSKEY"
db = dynamo.createClient(dbConf, dbConf.credentials)