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.
To build the example, run the following command:
make
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.
To start the app and an LFE shell:
lfe -pa ebin -pa deps/*/ebin -s error-hook # make dev
Point your browser at http://localhost:8080 or use telnet
.
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.