-
Notifications
You must be signed in to change notification settings - Fork 352
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…202)
- Loading branch information
1 parent
604b6a7
commit 2c8231e
Showing
20 changed files
with
917 additions
and
216 deletions.
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
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,29 @@ | ||
# Event | ||
|
||
## Properties | ||
|
||
### type | ||
|
||
_Type_: `String` | ||
|
||
The event type. (e.g. `request`, `response`, `beforePersist`) | ||
|
||
## Methods | ||
|
||
### stopPropagation | ||
|
||
If several event listeners are attached to the same event type, they are called in the order in which they were added. If `stopPropagation` is invoked during one such call, no remaining listeners will be called. | ||
|
||
**Example** | ||
|
||
```js | ||
server.get('/session/:id').on('beforeResponse', (req, res, event) => { | ||
event.stopPropagation(); | ||
res.setHeader('X-SESSION-ID', 'ABC123'); | ||
}); | ||
|
||
server.get('/session/:id').on('beforeResponse', (req, res, event) => { | ||
// This will never be reached | ||
res.setHeader('X-SESSION-ID', 'XYZ456'); | ||
}); | ||
``` |
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
Oops, something went wrong.