Skip to content

Latest commit

 

History

History

chunked-hello-world

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

Chunked hello world 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/chunked-hello-world-example/bin/chunked-hello-world-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 chunked-hello-world # make dev

Usage

Point your browser at http://localhost:8080, or use http to see the chunks arriving one at a time every second.

Example output

time http -vS :8080 # -S, --stream => streamed responses
GET / HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Host: localhost:8080
User-Agent: HTTPie/0.9.2
HTTP/1.1 200 OK
date: Mon, 21 Sep 2015 22:46:10 GMT
server: Cowboy
transfer-encoding: chunked
Hello

One second later:

World

One second later:

Chunked!
2.23 real         0.18 user         0.04 sys