mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-15 20:50:24 +00:00
Add an example of onresponse hooks
Also fix the guide entry on hooks.
This commit is contained in:
parent
23b3b038e9
commit
88414e36b4
10 changed files with 143 additions and 2 deletions
30
examples/error_hook/README.md
Normal file
30
examples/error_hook/README.md
Normal file
|
@ -0,0 +1,30 @@
|
|||
Cowboy Error Hook
|
||||
=================
|
||||
|
||||
To compile this example you need rebar in your PATH.
|
||||
|
||||
Type the following command:
|
||||
```
|
||||
$ rebar get-deps compile
|
||||
```
|
||||
|
||||
You can then start the Erlang node with the following command:
|
||||
```
|
||||
./start.sh
|
||||
```
|
||||
|
||||
Then point your browser to the indicated URL.
|
||||
|
||||
Example
|
||||
-------
|
||||
|
||||
``` bash
|
||||
$ curl -i http://localhost:8080
|
||||
HTTP/1.1 404 Not Found
|
||||
connection: keep-alive
|
||||
server: Cowboy
|
||||
date: Wed, 27 Feb 2013 23:32:55 GMT
|
||||
content-length: 56
|
||||
|
||||
404 Not Found: "/" is not the path you are looking for.
|
||||
```
|
Loading…
Add table
Add a link
Reference in a new issue