Skip to content

Instantly share code, notes, and snippets.

@nlf
Created August 26, 2015 18:46
Show Gist options
  • Select an option

  • Save nlf/b75d78b3104c9a055ee4 to your computer and use it in GitHub Desktop.

Select an option

Save nlf/b75d78b3104c9a055ee4 to your computer and use it in GitHub Desktop.
var handler = function (request, reply) {
doSomethingWithAPromise().then(function (result) {
if (!result) {
return reply.view('error');
}
return reply.view('success');
}).catch(function (err) {
return reply.view('error');
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment