Skip to content

Instantly share code, notes, and snippets.

@bardic
Created October 14, 2019 19:30
Show Gist options
  • Select an option

  • Save bardic/1741902a92864bc5c5d461a509b49319 to your computer and use it in GitHub Desktop.

Select an option

Save bardic/1741902a92864bc5c5d461a509b49319 to your computer and use it in GitHub Desktop.
router
.get('/cat', (ctx, next) => {
ctx.body = "Hello"
r.table('authors').run(connection, function(err, cursor) {
if (err) throw err;
cursor.toArray(function(err, result) {
if (err) throw err
console.log(ctx)
//THIS PART DOESN'T WORK
ctx.body += result[0].name
});
});
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment