merry
merry copied to clipboard
question - route handler signature
Hi, it is unclear to me what the done
function is here. Maybe I missed it… I can't find it in the documentation.
https://github.com/shipharbor/merry#handler--appstart
function handleRoute (req, res, ctx, done) {
done(null, 'hello planet')
}
Thanks. I like your API a lot in this project.
ooooo! thanks for this! this is a bug in documentation and is what's left over from a previous version of the API. This should read:
function handleRoute (req, res, ctx) {
ctx.send(200, { message: 'hello planet' })
}
or something of the sort. e.g. there is no more done
and you'd just send with ctx.send
or res.end()
.