function render(viewName, layoutPath) {
    if (!layoutPath) {
        return function (req, res) {
            res.render(viewName);
        };
    }
    else {
        return function (req, res) {
            res.render(viewName, { layout: layoutPath });
        };
    }

}

module.exports = {
    render: render
};

function render(viewName, layoutPath) {
    return function (req, res) {
        if (layoutPath) {
            res.locals.layout = layoutPath;
        }

        res.render(viewName);
    };
}

module.exports = {
    render: render
};

Change implementation of `render` route
Change implementation of `render` route
