| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 1× 1× 1× 7× 2× 7× 1× | const d = require("describe-property");
const RoutingMethods = {
delete: "DELETE",
get: ["GET", "HEAD"],
head: "HEAD",
options: "OPTIONS",
post: "POST",
put: "PUT",
trace: "TRACE"
};
const RoutingProperties = Object.keys(RoutingMethods).reduce(function (memo, method) {
memo[method] = d(function (pattern, app) {
return this.route(pattern, RoutingMethods[method], app);
});
return memo;
}, {});
module.exports = RoutingProperties;
|