diff --git a/serverless-backend/particle-backend/handler.js b/serverless-backend/particle-backend/handler.js index 88ef060f..24baf4ff 100644 --- a/serverless-backend/particle-backend/handler.js +++ b/serverless-backend/particle-backend/handler.js @@ -40,14 +40,15 @@ module.exports.events = async event => { if (event.httpMethod === 'OPTIONS') { return processResponse(IS_CORS); } + const event_name = event.pathParameters.event_name; let params = { TableName: TABLE_NAME, - FilterExpression: "#ev = :Roll", + FilterExpression: "#01 = :02", ExpressionAttributeNames: { - "#ev": "event" + "#01": "event" }, ExpressionAttributeValues: { - ":Roll": "Rollade_1" + ":02": event_name } } try { diff --git a/serverless-backend/particle-backend/serverless.yml b/serverless-backend/particle-backend/serverless.yml index 8d8ed888..811e73d8 100644 --- a/serverless-backend/particle-backend/serverless.yml +++ b/serverless-backend/particle-backend/serverless.yml @@ -53,7 +53,7 @@ functions: description: Getting events from Particle.io from DynamoDB events: - http: - path: events + path: events/{event_name} method: get cors: true private: true