mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Update examples to the new interface
This commit is contained in:
parent
00f3ae7d20
commit
ae95e87eb1
5 changed files with 11 additions and 11 deletions
|
@ -6,10 +6,10 @@
|
|||
-export([init/2]).
|
||||
|
||||
init(Req, Opts) ->
|
||||
cowboy_req:chunked_reply(200, Req),
|
||||
cowboy_req:chunk("Hello\r\n", Req),
|
||||
cowboy_req:stream_reply(200, Req),
|
||||
cowboy_req:stream_body("Hello\r\n", nofin, Req),
|
||||
timer:sleep(1000),
|
||||
cowboy_req:chunk("World\r\n", Req),
|
||||
cowboy_req:stream_body("World\r\n", nofin, Req),
|
||||
timer:sleep(1000),
|
||||
cowboy_req:chunk("Chunked!\r\n", Req),
|
||||
cowboy_req:stream_body("Chunked!\r\n", fin, Req),
|
||||
{ok, Req, Opts}.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue