Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
feat(req): add restifyDone event (#1740)
- Loading branch information
Showing
5 changed files
with
214 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
### restifyDone | ||
|
||
After request has been fully serviced, an `restifyDone` event is fired. | ||
restify considers a request to be fully serviced when either: | ||
|
||
1) The handler chain for a route has been fully completed | ||
2) An error was returned to `next()`, and the corresponding error events have | ||
been fired for that error type | ||
|
||
The signature for the `restifyDone` event is as follows: | ||
|
||
```js | ||
function(route, error) { } | ||
``` | ||
|
||
* `route` - the route object that serviced the request | ||
* `error` - the error passed to `next()`, if applicable | ||
|
||
Note that when the server automatically responds with a | ||
`NotFound`/`MethodNotAllowed`/`VersionNotAllowed`, this event will still be | ||
fired. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
toc: | ||
- Request | ||
- name: Events | ||
file: ../api/server-events.md | ||
- name: Log | ||
file: ../api/request-log.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters