all files / modules/utils/ RoutingProperties.js

100% Statements 7/7
100% Branches 0/0
100% Functions 2/2
100% Lines 7/7
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22                              
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;