My hashkey is a number with the name pid
Here is the code
app.get('/register', (req, res) => {
var params = {
TableName:"passengers",
Item: {
"pid": 55
}
};
console.log("Adding a new item...");
docClient.put(params, function(err, data) {
if (err) {
console.log("errrrrrrr");
console.error("Unable to add item. Error JSON:", JSON.stringify(err, null, 2));
} else {
console.log("succccccc");
console.log("Added item:", JSON.stringify(data, null, 2));
}
});
console.log("Added a new item...");
res.send('<h1>some html</h1>');
})
Neither errrr or succcc gets printed in the logs but both "Adding a new item" and "Added a new item" get printed.