@middy/http-router 3.4.0 → 3.5.0
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/index.cjs +2 -1
- package/index.js +2 -1
- package/package.json +4 -4
package/index.cjs
CHANGED
|
@@ -63,6 +63,7 @@ const attachStaticRoute = (method, path, handler, routesType)=>{
|
|
|
63
63
|
routesType[method] = {};
|
|
64
64
|
}
|
|
65
65
|
routesType[method][path] = handler;
|
|
66
|
+
routesType[method][path + '/'] = handler;
|
|
66
67
|
};
|
|
67
68
|
const attachDynamicRoute = (method, path, handler, routesType)=>{
|
|
68
69
|
if (method === 'ANY') {
|
|
@@ -75,7 +76,7 @@ const attachDynamicRoute = (method, path, handler, routesType)=>{
|
|
|
75
76
|
routesType[method] = [];
|
|
76
77
|
}
|
|
77
78
|
path = path.replace(regexpDynamicWildcards, '/?.*').replace(regexpDynamicParameters, '/[^/]+');
|
|
78
|
-
path = new RegExp(`^${path}
|
|
79
|
+
path = new RegExp(`^${path}/?$`);
|
|
79
80
|
routesType[method].push({
|
|
80
81
|
path,
|
|
81
82
|
handler
|
package/index.js
CHANGED
|
@@ -55,6 +55,7 @@ const attachStaticRoute = (method, path, handler, routesType)=>{
|
|
|
55
55
|
routesType[method] = {};
|
|
56
56
|
}
|
|
57
57
|
routesType[method][path] = handler;
|
|
58
|
+
routesType[method][path + '/'] = handler;
|
|
58
59
|
};
|
|
59
60
|
const attachDynamicRoute = (method, path, handler, routesType)=>{
|
|
60
61
|
if (method === 'ANY') {
|
|
@@ -67,7 +68,7 @@ const attachDynamicRoute = (method, path, handler, routesType)=>{
|
|
|
67
68
|
routesType[method] = [];
|
|
68
69
|
}
|
|
69
70
|
path = path.replace(regexpDynamicWildcards, '/?.*').replace(regexpDynamicParameters, '/[^/]+');
|
|
70
|
-
path = new RegExp(`^${path}
|
|
71
|
+
path = new RegExp(`^${path}/?$`);
|
|
71
72
|
routesType[method].push({
|
|
72
73
|
path,
|
|
73
74
|
handler
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@middy/http-router",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0",
|
|
4
4
|
"description": "HTTP event router for the middy framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
@@ -62,11 +62,11 @@
|
|
|
62
62
|
},
|
|
63
63
|
"homepage": "https://middy.js.org",
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@middy/util": "3.
|
|
65
|
+
"@middy/util": "3.5.0"
|
|
66
66
|
},
|
|
67
67
|
"devDependencies": {
|
|
68
|
-
"@middy/core": "3.
|
|
68
|
+
"@middy/core": "3.5.0",
|
|
69
69
|
"@types/aws-lambda": "^8.10.97"
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "61d1bb405d23702dd8ee83b65d8b98bef7acaeeb"
|
|
72
72
|
}
|