json
Response method responsible for handling json style payloads
const { response } = require('octoris')
Arguments
Usage
const { response } = require('octoris')
// Since responses are curried we can create a basic status code constant
const OK = response.json(200)
function homeHandler (ctx) {
return OK({ foo: 'bar' })
}
function aboutHandler (ctx) {
return response.send(201, { a: 1, b: 2 })
}Last updated
Was this helpful?