@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 +2 -2
- package/lib/cowboy.js +2 -0
- package/middleware/apiTally.js +1 -1
- package/package.json +1 -1
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) }
|
package/middleware/apiTally.js
CHANGED
|
@@ -73,7 +73,7 @@ export default function CowboyMiddlewareApiTally(options) {
|
|
|
73
73
|
},
|
|
74
74
|
} : undefined,
|
|
75
75
|
request: {
|
|
76
|
-
path: req.
|
|
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
|