Skip to content

Instantly share code, notes, and snippets.

@bytespider
Created February 6, 2013 09:10
Show Gist options
  • Save bytespider/4721336 to your computer and use it in GitHub Desktop.
Save bytespider/4721336 to your computer and use it in GitHub Desktop.
Using promises in a node js server
var path = Url.parse(request.url).path;
router.route(path)
.then(dispatchRoute)
.then(handleResponse)
.fail(handleError) // handle application errors
.fail(handleServerError); // catch all others
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment