MCPcopy Create free account
hub / github.com/aws-samples/serverless-coffee / getConfig

Function getConfig

backends/9-validator/code/ddb.js:10–31  ·  view source on GitHub ↗
(id)

Source from the content-addressed store, hash-verified

8
9
10const getConfig = async (id) => {
11 const PKvalue = `config-${id}`
12 const params = {
13 TableName: process.env.ConfigTableName,
14 KeyConditionExpression: "#pk = :pk",
15 ExpressionAttributeNames: {
16 "#pk": "PK"
17 },
18 ExpressionAttributeValues: {
19 ":pk": PKvalue
20 }
21 }
22 console.log('getConfig params: ', params)
23
24 try {
25 const result = await documentClient.query(params).promise()
26 console.log('getConfig result: ', result.Items)
27 return result.Items
28 } catch (err) {
29 console.error('getConfig error: ', err)
30 }
31}
32
33const getItem = async (id) => {
34 const params = {

Callers 1

getCode.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected