aws-architect 6.6.41 → 6.6.43
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.
- package/lib/server.js +3 -3
- package/package.json +1 -1
package/lib/server.js
CHANGED
|
@@ -105,10 +105,10 @@ function Server(contentDirectory, lambdaApi, logger) {
|
|
|
105
105
|
});
|
|
106
106
|
|
|
107
107
|
Object.keys(lambdaApi.Routes || []).map(method => {
|
|
108
|
-
Object.keys(lambdaApi.Routes[method]).
|
|
108
|
+
const sortedPathKeys = Object.keys(lambdaApi.Routes[method]).sort((a, b) => a.split('/').length - b.split('/').length || a.split('{').length - b.split('{').length);
|
|
109
|
+
sortedPathKeys.map(resource => {
|
|
109
110
|
let isProxy = resource.match(/{proxy\+}/);
|
|
110
|
-
|
|
111
|
-
let expressResource = resource.replace(/{proxy\+}/, '*').replace(/{([^\{\}]+)}/g, ':$1');
|
|
111
|
+
let expressResource = resource.replace(/{proxy\+}/, '*').replace(/{([^{}]+)}/g, ':$1');
|
|
112
112
|
api.all(expressResource, async (req, res) => {
|
|
113
113
|
let event = {
|
|
114
114
|
resource: resource,
|