0
Fork 0
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:
Loïc Hoguin 2016-08-10 14:33:43 +02:00
parent 00f3ae7d20
commit ae95e87eb1
5 changed files with 11 additions and 11 deletions

View file

@ -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}.