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:
parent
5838a0c81a
commit
271e31c629
8 changed files with 66 additions and 29 deletions
|
@ -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]
|
||||
----
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue