mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-15 04:30:25 +00:00
Fix ssl_hello_world example; document HTTP/2 output
This commit is contained in:
parent
ff936ff0ee
commit
25912dfc05
4 changed files with 66 additions and 7 deletions
|
@ -22,7 +22,7 @@ start(_Type, _Args) ->
|
|||
{cacertfile, PrivDir ++ "/ssl/cowboy-ca.crt"},
|
||||
{certfile, PrivDir ++ "/ssl/server.crt"},
|
||||
{keyfile, PrivDir ++ "/ssl/server.key"}
|
||||
], #{env, [{dispatch, Dispatch}]}),
|
||||
], #{env => #{dispatch => Dispatch}}),
|
||||
ssl_hello_world_sup:start_link().
|
||||
|
||||
stop(_State) ->
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
-export([init/2]).
|
||||
|
||||
init(Req, Opts) ->
|
||||
Req2 = cowboy_req:reply(200, [
|
||||
{<<"content-type">>, <<"text/plain">>}
|
||||
], <<"Hello world!">>, Req),
|
||||
{ok, Req2, Opts}.
|
||||
cowboy_req:reply(200, #{
|
||||
<<"content-type">> => <<"text/plain">>
|
||||
}, <<"Hello world!">>, Req),
|
||||
{ok, Req, Opts}.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue