0
Fork 0
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:
Loïc Hoguin 2016-04-30 14:58:32 +02:00
parent ff936ff0ee
commit 25912dfc05
4 changed files with 66 additions and 7 deletions

View file

@ -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) ->

View file

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