0
Fork 0
mirror of https://github.com/ninenines/cowboy.git synced 2025-07-15 20:50:24 +00:00

Various fixes and tweaks to the user guide

This commit is contained in:
Loïc Hoguin 2017-01-02 14:20:15 +01:00
parent 5838a0c81a
commit 271e31c629
No known key found for this signature in database
GPG key ID: 71366FF21851DF03
8 changed files with 66 additions and 29 deletions

View file

@ -29,9 +29,9 @@ We need to use the Req object to reply.
[source,erlang]
----
init(Req0, State) ->
Req = cowboy_req:reply(200, [
{<<"content-type">>, <<"text/plain">>}
], <<"Hello World!">>, Req0),
Req = cowboy_req:reply(200, #{
<<"content-type">> => <<"text/plain">>
}, <<"Hello World!">>, Req0),
{ok, Req, State}.
----
@ -81,8 +81,7 @@ xref:sub_protocols[Sub protocols] chapter.
=== Cleaning up
With the exception of Websocket handlers, all handler types
provide the optional `terminate/3` callback.
All handler types provide the optional `terminate/3` callback.
[source,erlang]
----