merry icon indicating copy to clipboard operation
merry copied to clipboard

question - route handler signature

Open nichoth opened this issue 6 years ago • 1 comments

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.

nichoth avatar Dec 04 '17 17:12 nichoth

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().

lrlna avatar Dec 12 '17 03:12 lrlna