clay-lambda
Advanced tools
+14
-4
@@ -0,1 +1,3 @@ | ||
| const Route = require('route-parser'); | ||
| let routes = [] | ||
@@ -21,4 +23,8 @@ | ||
| if (route.path == apiPath | ||
| let match = route.route.match(apiPath) | ||
| if (match !== false | ||
| && (route.method == method || route.method == '*')) { | ||
| event.params = match | ||
| return route.fn(event, done, fail) | ||
@@ -33,7 +39,11 @@ } | ||
| return function (path, fn) { | ||
| routes.push({ | ||
| const route = { | ||
| method: type, | ||
| fn, | ||
| path | ||
| }) | ||
| route: new Route(path) | ||
| } | ||
| routes.push(route) | ||
| return route | ||
| } | ||
@@ -40,0 +50,0 @@ } |
+5
-2
| { | ||
| "name": "clay-lambda", | ||
| "version": "1.0.2", | ||
| "version": "1.0.3", | ||
| "description": "", | ||
@@ -10,3 +10,6 @@ "main": "index.js", | ||
| "author": "", | ||
| "license": "ISC" | ||
| "license": "ISC", | ||
| "dependencies": { | ||
| "route-parser": "0.0.5" | ||
| } | ||
| } |
1538
18.31%41
13.89%1
Infinity%+ Added
+ Added