0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-16 05:00:24 +00:00

Fix chunked_hello_world example

This commit is contained in:
Loïc Hoguin 2016-06-13 16:26:00 +02:00
parent b82bb92f7e
commit 6f75598b70
4 changed files with 96 additions and 9 deletions

View file

@ -6,10 +6,10 @@
-export([init/2]).
init(Req, Opts) ->
Req2 = cowboy_req:chunked_reply(200, Req),
cowboy_req:chunk("Hello\r\n", Req2),
cowboy_req:chunked_reply(200, Req),
cowboy_req:chunk("Hello\r\n", Req),
timer:sleep(1000),
cowboy_req:chunk("World\r\n", Req2),
cowboy_req:chunk("World\r\n", Req),
timer:sleep(1000),
cowboy_req:chunk("Chunked!\r\n", Req2),
{ok, Req2, Opts}.
cowboy_req:chunk("Chunked!\r\n", Req),
{ok, Req, Opts}.