mirror of
https://github.com/ninenines/cowboy.git
synced 2025-07-14 12:20:24 +00:00
Fix hello_world example
This commit is contained in:
parent
45158c1da4
commit
ff936ff0ee
2 changed files with 7 additions and 7 deletions
|
@ -16,9 +16,9 @@ start(_Type, _Args) ->
|
|||
{"/", toppage_handler, []}
|
||||
]}
|
||||
]),
|
||||
{ok, _} = cowboy:start_http(http, 100, [{port, 8080}], [
|
||||
{env, [{dispatch, Dispatch}]}
|
||||
]),
|
||||
{ok, _} = cowboy:start_clear(http, 100, [{port, 8080}], #{
|
||||
env => #{dispatch => Dispatch}
|
||||
}),
|
||||
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