const template = 'index/partials/on_click' const action = 'client/clicked' const state = { msg: 'wowow', h: 'registered jobs' } const handler = (request, h) => { const { timeline } = request.server.services() const jobs = timeline.bree.config.jobs return h.view(template, { ...state, jobs }) } /** * Corresponds with templates/index/partials/clicked.pug */ module.exports = { method: 'POST', path: `/${action}`, options: { handler } }