From 7c01f518e72d3743dbba7adae5269f7cb726e7c1 Mon Sep 17 00:00:00 2001 From: Hemil Desai Date: Wed, 3 Apr 2019 10:48:41 -0700 Subject: [PATCH] Make `resource` a `var` instead of `const` Line 36 gives `TypeError: Assignment to constant variable.` if `resource` is `const` --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index fb85396..9ef0d4f 100644 --- a/index.js +++ b/index.js @@ -30,7 +30,7 @@ exports.handler = function(event, context) { apiOptions.restApiId = apiGatewayArnPart[0]; apiOptions.stage = apiGatewayArnPart[1]; const method = apiGatewayArnPart[2]; - const resource = '/'; // root resource + var resource = '/'; // root resource if (apiGatewayArnPart[3]) { resource += apiGatewayArnPart[3];