1.1.2 • Published 8 years ago

pcb-direct v1.1.2

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

pcb-direct

Direct adapter for PCB. Passthrough to pcb.call(), with the difference of it returning ctx.response, instead of ctx.

import pcbDirect from 'pcb-direct'

// assuming pcb is a set up PCB instance
const localAPI = pcbDirect(pcb, defaultMeta)
// defaultMeta is an optional variable to pass to the call if none is provided

// assuming this is the handler for route name "do/thing"
async function doThingHandler (resource, data) {
  return 'nice' + data
}

const a = await localAPI('/do/thing', 'hey')
a === 'nicehey'
1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago