Javascript 在树莓皮上设置DynamoDB表

Javascript 在树莓皮上设置DynamoDB表,javascript,raspberry-pi,amazon-dynamodb,Javascript,Raspberry Pi,Amazon Dynamodb,我试图在我的raspberry pi上设置一个dynamodb表,但遇到了一个奇怪的网络问题 pi@raspberrypi:~/Casty/InitDynamoDB $ node CreateMovieListTable.js Adding a new item... Unable to add item. Error JSON: { "message": "connect ECONNREFUSED", "code": "NetworkingError", "errno

我试图在我的raspberry pi上设置一个dynamodb表,但遇到了一个奇怪的网络问题

pi@raspberrypi:~/Casty/InitDynamoDB $ node CreateMovieListTable.js 
Adding a new item...
Unable to add item. Error JSON: {
    "message": "connect ECONNREFUSED",
    "code": "NetworkingError",
    "errno": "ECONNREFUSED",
    "syscall": "connect",
    "region": "us-west-2",
    "hostname": "localhost",
    "retryable": true,
    "time": "2016-07-03T00:18:18.983Z"
}
我能够ping localhost,pi连接到wifi。有人知道发生了什么事吗?下面是我用来创建表的代码。多谢各位

var AWS = require("aws-sdk");

AWS.config.update({
  region: "us-west-2",
  endpoint: "http://localhost:8000"
});

var dynamodb = new AWS.DynamoDB();

var params = {
    TableName : "MovieList",
    KeySchema: [
        { AttributeName: "year", KeyType: "HASH"},  //Partition key
        { AttributeName: "title", KeyType: "RANGE" }  //Sort key
    ],
    AttributeDefinitions: [
        { AttributeName: "year", AttributeType: "N" },
        { AttributeName: "title", AttributeType: "S" }
    ],
    ProvisionedThroughput: {
        ReadCapacityUnits: 10,
        WriteCapacityUnits: 10
    }
};

dynamodb.createTable(params, function(err, data) {
    if (err) {
        console.error("Unable to create table. Error JSON:", JSON.stringify(err, null, 2));
    } else {
        console.log("Created table. Table description JSON:", JSON.stringify(data, null, 2));
    }
});
或许

“您需要更改应用程序中的端点才能使用 亚马逊DynamoDB服务。”

参考:

AWS.config.update({endpoint: "https://dynamodb.us-west-2.amazonaws.com"});