-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
59 additions
and
10 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,8 @@ | ||
# Plugins and handlers | ||
# Handlers | ||
|
||
## Handlers | ||
|
||
Handlers are a nifty thing that is called on when the controller returns. For example if the controller returns | ||
`{json, #{hello => world}}` we would like Nova to create a proper JSON response to the requester. That means setting correct | ||
headers, encode the payload and send it out. This is what _handlers_ are for. They are (often short) functions that transforms something like | ||
`{json, Payload}` to proper output. | ||
|
||
## Plugins | ||
|
||
Plugins are a bit like the handlers except they are run on request. There's currently two different type of plugins; `pre_request` and `post_request`. | ||
These can be used to create access logs, insert CORS headers or similar. |
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
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