@yopdev/dev-server 1.2.0-alpha.0 → 1.2.0-alpha.1

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.
@@ -6,7 +6,7 @@ export declare const newLambdaHttpProxy: (name: string, config: {
6
6
  routes: Route[];
7
7
  }, callback?: Callback<string>) => Service<string>;
8
8
  type Route = {
9
- method: string;
9
+ method: RegExp;
10
10
  path: RegExp;
11
11
  handler: (event: APIGatewayProxyEvent) => Promise<APIGatewayProxyResult>;
12
12
  };
@@ -30,7 +30,7 @@ var LambdaHttpProxy = /** @class */ (function () {
30
30
  };
31
31
  };
32
32
  this.resolveRoute = function (request, body, response) {
33
- return _this.routes.filter(function (r) { return r.method === request.method; })
33
+ return _this.routes.filter(function (r) { return request.method.match(r.method); })
34
34
  .filter(function (r) { return request.url.match(r.path); })
35
35
  .sort(function (r1, r2) { return r2.path.source.length - r1.path.source.length; })
36
36
  .map(function (r) { return _this.handler(r.handler); })[0](request, body, response);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yopdev/dev-server",
3
- "version": "1.2.0-alpha.0",
3
+ "version": "1.2.0-alpha.1",
4
4
  "scripts": {
5
5
  "compile": "tsc",
6
6
  "test": "jest",