JSFiddle - React, Tailwind, and code Playground

JavaScript

var obj = {
    method: 'GET',
    path: '/getAllParties',
    handler: function (request, reply) {
        //some code
    },
    getConfig: function () {
        return {
            description: this.path + " route."
        }
    }
}

console.log(obj.getConfig().description)