aws-architect 6.7.127 → 6.7.128

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/server.js +3 -3
  2. package/package.json +1 -1
package/lib/server.js CHANGED
@@ -122,8 +122,8 @@ function Server(contentDirectory, lambdaApi, logger) {
122
122
  Object.keys(routes).map(method => {
123
123
  const sortedPathKeys = Object.keys(routes[method]).sort((a, b) => a.split('/').length - b.split('/').length || a.split('{').length - b.split('{').length);
124
124
  sortedPathKeys.map(resource => {
125
- let isProxy = resource.match(/{proxy\+}/);
126
- let expressResource = resource.replace(/{proxy\+}/, '*proxy').replace(/{([^{}]+)}/g, ':$1');
125
+ const isProxyMatcher = resource.match(/{([a-z]+)\+}/i);
126
+ let expressResource = resource.replace(/{([a-z]+)\+}/i, '*$1').replace(/{([^{}]+)}/g, ':$1');
127
127
  api.all(expressResource, async (req, res) => {
128
128
  let event = {
129
129
  resource: resource,
@@ -131,7 +131,7 @@ function Server(contentDirectory, lambdaApi, logger) {
131
131
  httpMethod: req.method,
132
132
  headers: req.headers || {},
133
133
  queryStringParameters: req.query,
134
- pathParameters: isProxy ? { proxy: req.params[0] } : req.params || {},
134
+ pathParameters: isProxyMatcher ? { [isProxyMatcher[1]]: req.params[0] } : req.params || {},
135
135
  body: req.body,
136
136
  stageVariables: { lambdaVersion: 'local' },
137
137
  requestContext: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "aws-architect",
3
- "version": "6.7.127",
3
+ "version": "6.7.128",
4
4
  "description": "AWS Architect is a node based tool to configure and deploy AWS-based microservices.",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",