Browse files

GH-113 document return next(false);

  • Loading branch information...
1 parent b8ef375 commit 145ec022d2ab0c670c8e3911f47480bb4b18db91 @mcavage mcavage committed Apr 17, 2012
Showing with 9 additions and 0 deletions.
  1. +1 −0
  2. +8 −0 docs/index.restdown
@@ -7,6 +7,7 @@
- GH-122 Response._writeHead can cause infinite loop (Trent Mick)
- GH-120 Allow server.patch (Paul Bouzakis)
- GH-119 defaultResponseHeaders not settable
+- GH-113 document `return next(false)`
## 1.4.0
@@ -207,6 +207,14 @@ Here any request like:
Would result in `req.params[0]` being `foo` and `req.params[1]` being
`my/cats/name/is/gandalf`. Basically, you can do whatever you want.
+Note the use of calling `next()`. You are responsible for calling this in
+order to run the next handler in the chain. As below, you can pass an
+Error object in to have restify automatically return responses to the client;
+additionally, you can pass in a `false` to not error, but to stop the handler
+chain. This is useful if you had a `res.send` in an early filter, which is
+not an error, and you possibly have one later you want to short-circuit.
### Versioned Routes
Most REST APIs tend to need versioning, and restify ships with support

0 comments on commit 145ec02

Please sign in to comment.