mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Make reply functions return Req
This commit is contained in:
parent
aa6f2ab5a4
commit
e30d120bd8
16 changed files with 109 additions and 108 deletions
|
@ -6,10 +6,10 @@
|
|||
-export([init/2]).
|
||||
-export([info/3]).
|
||||
|
||||
init(Req, Opts) ->
|
||||
cowboy_req:stream_reply(200, #{
|
||||
init(Req0, Opts) ->
|
||||
Req = cowboy_req:stream_reply(200, #{
|
||||
<<"content-type">> => <<"text/event-stream">>
|
||||
}, Req),
|
||||
}, Req0),
|
||||
erlang:send_after(1000, self(), {message, "Tick"}),
|
||||
{cowboy_loop, Req, Opts, 5000}.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue