summaryrefslogtreecommitdiffstats
path: root/docs/en/cowboy/2.4/manual/cowboy_handler/index.html
diff options
context:
space:
mode:
authorLoïc Hoguin <[email protected]>2018-06-13 09:54:12 +0200
committerLoïc Hoguin <[email protected]>2018-06-13 09:54:12 +0200
commit92b54aacc0de5446dd5497c39897b0bbff72e626 (patch)
treec3a98cfec636d1271f5804e5c19b35b208bba00d /docs/en/cowboy/2.4/manual/cowboy_handler/index.html
parent8b5c3dc972b99f174750123c9e4abc96259c34a9 (diff)
downloadninenines.eu-92b54aacc0de5446dd5497c39897b0bbff72e626.tar.gz
ninenines.eu-92b54aacc0de5446dd5497c39897b0bbff72e626.tar.bz2
ninenines.eu-92b54aacc0de5446dd5497c39897b0bbff72e626.zip
Rebuild using Asciideck
Diffstat (limited to 'docs/en/cowboy/2.4/manual/cowboy_handler/index.html')
-rw-r--r--docs/en/cowboy/2.4/manual/cowboy_handler/index.html108
1 files changed, 29 insertions, 79 deletions
diff --git a/docs/en/cowboy/2.4/manual/cowboy_handler/index.html b/docs/en/cowboy/2.4/manual/cowboy_handler/index.html
index 5414b066..e6a0c3f4 100644
--- a/docs/en/cowboy/2.4/manual/cowboy_handler/index.html
+++ b/docs/en/cowboy/2.4/manual/cowboy_handler/index.html
@@ -62,96 +62,46 @@
<h1 class="lined-header"><span>cowboy_handler(3)</span></h1>
-<div class="sect1">
<h2 id="_name">Name</h2>
-<div class="sectionbody">
-<div class="paragraph"><p>cowboy_handler - Plain HTTP handlers</p></div>
-</div>
-</div>
-<div class="sect1">
+<p>cowboy_handler - Plain HTTP handlers</p>
<h2 id="_description">Description</h2>
-<div class="sectionbody">
-<div class="paragraph"><p>The <code>cowboy_handler</code> middleware executes the handler selected
-by the router or any other preceding middleware.</p></div>
-<div class="paragraph"><p>This middleware takes the handler module and initial state
-from the <code>handler</code> and <code>handler_opts</code> environment values,
-respectively. On completion, it adds a <code>result</code> value to
-the middleware environment, containing the return value
-of the <code>terminate/3</code> callback (if defined) and <code>ok</code> otherwise.</p></div>
-<div class="paragraph"><p>This module also defines a callback interface for handling
-HTTP requests.</p></div>
-</div>
-</div>
-<div class="sect1">
+<p>The <code>cowboy_handler</code> middleware executes the handler selected by the router or any other preceding middleware.</p>
+<p>This middleware takes the handler module and initial state from the <code>handler</code> and <code>handler_opts</code> environment values, respectively. On completion, it adds a <code>result</code> value to the middleware environment, containing the return value of the <code>terminate/3</code> callback (if defined) and <code>ok</code> otherwise.</p>
+<p>This module also defines a callback interface for handling HTTP requests.</p>
<h2 id="_callbacks">Callbacks</h2>
-<div class="sectionbody">
-<div class="paragraph"><p>Plain HTTP handlers implement the following interface:</p></div>
-<div class="listingblock">
-<div class="content"><!-- Generator: GNU source-highlight
+<p>Plain HTTP handlers implement the following interface:</p>
+<div class="listingblock"><div class="content"><!-- Generator: GNU source-highlight 3.1.8
by Lorenzo Bettini
http://www.lorenzobettini.it
http://www.gnu.org/software/src-highlite -->
-<pre><tt><span style="font-weight: bold"><span style="color: #000000">init</span></span>(<span style="color: #009900">Req</span>, <span style="color: #009900">State</span>) <span style="color: #990000">-&gt;</span> {<span style="color: #FF6600">ok</span>, <span style="color: #009900">Req</span>, <span style="color: #009900">State</span>}
-
-<span style="font-weight: bold"><span style="color: #000000">terminate</span></span>(<span style="color: #009900">Reason</span>, <span style="color: #009900">Req</span>, <span style="color: #009900">State</span>) <span style="color: #990000">-&gt;</span> <span style="color: #FF6600">ok</span> <span style="font-style: italic"><span style="color: #9A1900">%% optional</span></span>
-
-<span style="color: #009900">Req</span> <span style="color: #990000">::</span> <span style="font-weight: bold"><span style="color: #000000">cowboy_req:req</span></span>()
-<span style="color: #009900">State</span> <span style="color: #990000">::</span> <span style="font-weight: bold"><span style="color: #000000">any</span></span>()
-<span style="color: #009900">Reason</span> <span style="color: #990000">::</span> <span style="font-weight: bold"><span style="color: #000080">normal</span></span>
- | {<span style="color: #FF6600">crash</span>, <span style="color: #FF6600">error</span> | <span style="font-weight: bold"><span style="color: #000080">exit</span></span> | <span style="font-weight: bold"><span style="color: #000080">throw</span></span>, <span style="font-weight: bold"><span style="color: #000000">any</span></span>()}</tt></pre></div></div>
-<div class="paragraph"><p>These two callbacks are common to all handlers.</p></div>
-<div class="paragraph"><p>Plain HTTP handlers do all their work in the <code>init/2</code>
-callback. Returning <code>ok</code> terminates the handler. If no
-response is sent, Cowboy will send a <code>204 No Content</code>.</p></div>
-<div class="paragraph"><p>The optional <code>terminate/3</code> callback will ultimately be called
-with the reason for the termination of the handler.
-Cowboy will terminate the process right after this. There
-is no need to perform any cleanup in this callback.</p></div>
-<div class="paragraph"><p>The following terminate reasons are defined for plain HTTP
-handlers:</p></div>
-<div class="dlist"><dl>
-<dt class="hdlist1">
-normal
-</dt>
-<dd>
-<p>
- The connection was closed normally.
-</p>
+<pre><tt><b><font color="#000000">init</font></b>(<font color="#009900">Req</font>, <font color="#009900">State</font>) <font color="#990000">-&gt;</font> {<font color="#FF6600">ok</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>}
+
+<b><font color="#000000">terminate</font></b>(<font color="#009900">Reason</font>, <font color="#009900">Req</font>, <font color="#009900">State</font>) <font color="#990000">-&gt;</font> <font color="#FF6600">ok</font> <i><font color="#9A1900">%% optional</font></i>
+
+<font color="#009900">Req</font> <font color="#990000">::</font> <b><font color="#000000">cowboy_req:req</font></b>()
+<font color="#009900">State</font> <font color="#990000">::</font> <b><font color="#000000">any</font></b>()
+<font color="#009900">Reason</font> <font color="#990000">::</font> <b><font color="#000080">normal</font></b>
+ | {<font color="#FF6600">crash</font>, <font color="#FF6600">error</font> | <b><font color="#000080">exit</font></b> | <b><font color="#000080">throw</font></b>, <b><font color="#000000">any</font></b>()}</tt></pre>
+</div></div>
+<p>These two callbacks are common to all handlers.</p>
+<p>Plain HTTP handlers do all their work in the <code>init/2</code> callback. Returning <code>ok</code> terminates the handler. If no response is sent, Cowboy will send a <code>204 No Content</code>.</p>
+<p>The optional <code>terminate/3</code> callback will ultimately be called with the reason for the termination of the handler. Cowboy will terminate the process right after this. There is no need to perform any cleanup in this callback.</p>
+<p>The following terminate reasons are defined for plain HTTP handlers:</p>
+<dl><dt>normal</dt>
+<dd><p>The connection was closed normally.</p>
</dd>
-<dt class="hdlist1">
-{crash, Class, Reason}
-</dt>
-<dd>
-<p>
- A crash occurred in the handler. <code>Class</code> and <code>Reason</code> can be
- used to obtain more information about the crash. The function
- <code>erlang:get_stacktrace/0</code> can also be called to obtain the
- stacktrace of the process when the crash occurred.
-</p>
+<dt>{crash, Class, Reason}</dt>
+<dd><p>A crash occurred in the handler. <code>Class</code> and <code>Reason</code> can be used to obtain more information about the crash. The function <code>erlang:get_stacktrace/0</code> can also be called to obtain the stacktrace of the process when the crash occurred.</p>
</dd>
-</dl></div>
-</div>
-</div>
-<div class="sect1">
+</dl>
<h2 id="_exports">Exports</h2>
-<div class="sectionbody">
-<div class="paragraph"><p>The following function should be called by modules implementing
-custom handlers to execute the optional terminate callback:</p></div>
-<div class="ulist"><ul>
-<li>
-<p>
-<a href="../cowboy_handler.terminate">cowboy_handler:terminate(3)</a> - Terminate the handler
-</p>
+<p>The following function should be called by modules implementing custom handlers to execute the optional terminate callback:</p>
+<ul><li><a href="../cowboy_handler.terminate">cowboy_handler:terminate(3)</a> - Terminate the handler
</li>
-</ul></div>
-</div>
-</div>
-<div class="sect1">
+</ul>
<h2 id="_see_also">See also</h2>
-<div class="sectionbody">
-<div class="paragraph"><p><a href="..">cowboy(7)</a></p></div>
-</div>
-</div>
+<p><a href="..">cowboy(7)</a></p>
+