0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-14 20:30:23 +00:00

More 2.0 documentation updates

Still incomplete.
This commit is contained in:
Loïc Hoguin 2016-08-24 17:25:33 +02:00
parent b9ad02d305
commit 7839f13671
9 changed files with 363 additions and 207 deletions

View file

@ -106,7 +106,7 @@ chapter. For this tutorial we map the path `/` to the handler
module `hello_handler`. This module doesn't exist yet.
Build and start the release, then open http://localhost:8080
in your browser. You will get an error because the module is missing.
in your browser. You will get a 500 error because the module is missing.
Any other URL, like http://localhost:8080/test, will result in a
404 error.
@ -126,11 +126,11 @@ the `init/2` function like this to send a reply.
[source,erlang]
----
init(Req, State) ->
cowboy_req:reply(200,
init(Req0, State) ->
Req = cowboy_req:reply(200,
#{<<"content-type">> => <<"text/plain">>},
<<"Hello Erlang!">>,
Req),
Req0),
{ok, Req, State}.
----