@momsfriendlydevco/cowboy 1.7.0 → 1.7.2

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/README.md CHANGED
@@ -108,8 +108,8 @@ import {Cowboy} from '@momsfriendlydevco/cowboy';
108
108
  The instance created by `cowboy()`.
109
109
 
110
110
 
111
- Cowboy.delete(path) / .get() / .head() / .post() / .put() / .options()
112
- ----------------------------------------------------------------------
111
+ Cowboy.delete(path) / .all() / .get() / .head() / .post() / .put() / .options()
112
+ -------------------------------------------------------------------------------
113
113
  Queue up a route with a given path.
114
114
 
115
115
  Each component is made up of a path + any number of middleware handlers.
package/lib/cowboy.js CHANGED
@@ -320,9 +320,11 @@ export class Cowboy {
320
320
 
321
321
 
322
322
  // Alias functions to route
323
+ all(path, ...middleware) { return this.route(['DELETE', 'GET', 'PATCH', 'POST', 'PUT'], path, ...middleware) }
323
324
  delete(path, ...middleware) { return this.route('DELETE', path, ...middleware) }
324
325
  get(path, ...middleware) { return this.route('GET', path, ...middleware) }
325
326
  head(path, ...middleware) { return this.route('HEAD', path, ...middleware) }
327
+ patch(path, ...middleware) { return this.route('PATCH', path, ...middleware) }
326
328
  post(path, ...middleware) { return this.route('POST', path, ...middleware) }
327
329
  put(path, ...middleware) { return this.route('PUT', path, ...middleware) }
328
330
  options(path, ...middleware) { return this.route('OPTIONS', path, ...middleware) }
@@ -73,7 +73,7 @@ export default function CowboyMiddlewareApiTally(options) {
73
73
  },
74
74
  } : undefined,
75
75
  request: {
76
- path: req.cfReq.routePath,
76
+ path: req.path,
77
77
  headers: Object.entries(req.headers),
78
78
  size: req.cfReq.headers.has('content-length') ? Number.parseInt(req.cfReq.headers.get('content-length')) : undefined,
79
79
  consumer: undefined, // FIXME: Where does this come from type is optional string
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@momsfriendlydevco/cowboy",
3
- "version": "1.7.0",
3
+ "version": "1.7.2",
4
4
  "description": "Wrapper around Cloudflare Wrangler to provide a more Express-like experience",
5
5
  "scripts": {
6
6
  "lint": "eslint"