Skip to content

Latest commit

 

History

History

error-hook

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

POST parameter echo example

To try this example, you need GNU make and git in your PATH.

If you don’t have HTTPie installed, use the appropriate cURL commands instead.

Building

To build the example, run the following command:

make

Starting

Release

To start the release in the foreground:

./_rel/error-hook-example/bin/error-hook-example console

Note: The previous command also starts an Erlang console.

LFE

To start the app and an LFE shell:

lfe -pa ebin -pa deps/*/ebin -s error-hook # make dev

Usage

Point your browser at http://localhost:8080 or use telnet.

Example output

http :8080
HTTP/1.1 404 Not Found
content-length: 56
date: Sun, 03 Jan 2016 09:15:04 GMT
server: Cowboy

404 Not Found: "/" is not the path you are looking for.
telnet localhost 8080
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
bad
HTTP/1.1 400 Bad Request
connection: close
server: Cowboy
date: Sun, 03 Jan 2016 09:16:07 GMT
content-length: 15

HTTP Error 400
Connection closed by foreign host.