You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/serverino.html
+5-5
Original file line number
Diff line number
Diff line change
@@ -91,7 +91,7 @@ <h1>Module serverino</h1><p>Serverino is a small and ready-to-go http server, in
91
91
<codeclass="lang-d"><ahref="./serverino/config/priority.html" title="serverino.config.priority"><spanclass="pln">priority</span></a></code> (default is 0). The first endpoint that write something to the output is the one that will respond to the request.
92
92
</p>
93
93
94
-
<p> The <codeclass="lang-d"><ahref="./serverino/config/route.html" title="serverino.config.route"><spanclass="pln">route</span></a></code> attribute can be used to filter the requests that are passed to the endpoint, using a uri or a <codeclass="lang-d"><spanclass="typ">bool </span><spanclass="kwd">delegate</span><spanclass="pun">(</span><spanclass="typ">Request </span><spanclass="pln">r</span><spanclass="pun">)</span></code> argument.
94
+
<p> The <codeclass="lang-d"><ahref="./serverino/config/route.html" title="serverino.config.route"><spanclass="pln">route</span></a></code> attribute can be used to filter the requests that are passed to the endpoint, using a path or a <codeclass="lang-d"><spanclass="typ">bool </span><spanclass="kwd">delegate</span><spanclass="pun">(</span><spanclass="typ">Request </span><spanclass="pln">r</span><spanclass="pun">)</span></code> argument.
95
95
In this example, only requests to <codeclass="lang-d"><spanclass="pun">/</span><spanclass="pln">hello</span></code> are passed to the <codeclass="lang-d"><spanclass="pln">hello</span></code> endpoint. The <codeclass="lang-d"><ahref="./serverino/config/route.html" title="serverino.config.route"><spanclass="pln">route</span></a></code> attribute can be used multiple times to specify multiple routes also using a delegate.
96
96
</p>
97
97
</section>
@@ -100,11 +100,11 @@ <h1>Module serverino</h1><p>Serverino is a small and ready-to-go http server, in
Copy file name to clipboardExpand all lines: docs/serverino/interfaces/Output.addHeader.html
+1-1
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@
49
49
<divid="main-contents">
50
50
<div>
51
51
<h1>Function Output.addHeader</h1><p>Add a http header.
52
-
You can't set <codeclass="lang-d"><spanclass="pln">content</span><spanclass="pun">-</span><spanclass="pln">length</span></code>, <codeclass="lang-d"><ahref="../../serverino/interfaces/Output.status.html"><spanclass="pln">status</span></a></code> or <codeclass="lang-d"><spanclass="pln">transfer</span><spanclass="pun">-</span><spanclass="pln">encoding</span></code> headers. They are managed by serverino internally.
52
+
You can't set <codeclass="lang-d"><spanclass="pln">content</span><spanclass="pun">-</span><spanclass="pln">length</span></code>, <codeclass="lang-d"><spanclass="pln">date</span></code>, <codeclass="lang-d"><ahref="../../serverino/interfaces/Output.status.html"><spanclass="pln">status</span></a></code> or <codeclass="lang-d"><spanclass="pln">transfer</span><spanclass="pun">-</span><spanclass="pln">encoding</span></code> headers. They are managed by serverino internally.
You can't set <codeclass="lang-d"><spanclass="pln">content</span><spanclass="pun">-</span><spanclass="pln">length</span></code>, <codeclass="lang-d"><ahref="../../serverino/interfaces/Output.status.html"><spanclass="pln">status</span></a></code> or <codeclass="lang-d"><spanclass="pln">transfer</span><spanclass="pun">-</span><spanclass="pln">encoding</span></code> headers. They are managed by serverino internally.
104
+
You can't set <codeclass="lang-d"><spanclass="pln">content</span><spanclass="pun">-</span><spanclass="pln">length</span></code>, <codeclass="lang-d"><spanclass="pln">date</span></code>, <codeclass="lang-d"><ahref="../../serverino/interfaces/Output.status.html"><spanclass="pln">status</span></a></code> or <codeclass="lang-d"><spanclass="pln">transfer</span><spanclass="pun">-</span><spanclass="pln">encoding</span></code> headers. They are managed by serverino internally.
105
105
</td>
106
106
</tr>
107
107
<tr>
@@ -131,7 +131,7 @@ <h1>Struct Output</h1><p>A response to user. Default content-type is "text/html"
<td>You can reply with a file. Automagical mime-type detection.
134
+
<td>Serve a file from disk. If you want to delete the file after serving it, use <codeclass="lang-d"><spanclass="pln">serveFile</span><spanclass="pun">!(</span><spanclass="typ">OnFileServed<wbr/></span><spanclass="pun">.</span><spanclass="pln">deleteFile</span><spanclass="pun">)</span></code>.
Copy file name to clipboardExpand all lines: docs/serverino/interfaces/Output.serveFile.html
+7-4
Original file line number
Diff line number
Diff line change
@@ -48,23 +48,26 @@
48
48
</nav>
49
49
<divid="main-contents">
50
50
<div>
51
-
<h1>Function Output.serveFile</h1><p>You can reply with a file. Automagical mime-type detection.
51
+
<h1>Function Output.serveFile</h1><p>Serve a file from disk. If you want to delete the file after serving it, use <codeclass="lang-d"><spanclass="pln">serveFile</span><spanclass="pun">!(</span><spanclass="typ">OnFileServed<wbr/></span><spanclass="pun">.</span><spanclass="pln">deleteFile</span><spanclass="pun">)</span></code>.
</span><spanclass="pln">info</span><spanclass="pun">(</span><spanclass="str">"You asked for "</span><spanclass="pun">, </span><spanclass="pln">request<wbr/></span><spanclass="pun">.</span><spanclass="pln">uri</span><spanclass="pun">, </span><spanclass="str">" with method "</span><spanclass="pun">, </span><spanclass="pln">request<wbr/></span><spanclass="pun">.</span><spanclass="pln">method</span><spanclass="pun">, </span><spanclass="str">" and params "</span><spanclass="pun">, </span><spanclass="pln">request<wbr/></span><spanclass="pun">.</span><spanclass="pln">get<wbr/></span><spanclass="pun">.</span><spanclass="pln">data</span><spanclass="pun">);
63
+
</span><spanclass="pln">info</span><spanclass="pun">(</span><spanclass="str">"You asked for "</span><spanclass="pun">, </span><spanclass="pln">request<wbr/></span><spanclass="pun">.</span><spanclass="pln">path</span><spanclass="pun">, </span><spanclass="str">" with method "</span><spanclass="pun">, </span><spanclass="pln">request<wbr/></span><spanclass="pun">.</span><spanclass="pln">method</span><spanclass="pun">, </span><spanclass="str">" and params "</span><spanclass="pun">, </span><spanclass="pln">request<wbr/></span><spanclass="pun">.</span><spanclass="pln">get<wbr/></span><spanclass="pun">.</span><spanclass="pln">data</span><spanclass="pun">);
64
64
}</span></code></pre>
65
65
</section>
66
66
@@ -124,6 +124,13 @@ <h1>Struct Request</h1><p>A request from user. Do not store ref to this struct a
<tdclass="typecol"><codeclass="prettyprint lang-d"><spanclass="kwd">const</span><spanclass="pun">(</span><spanclass="typ">string</span><spanclass="pun">)</span></code></td><td>Basic http authentication password. Safe only if sent thru https!
<tdclass="typecol"><codeclass="prettyprint lang-d"><spanclass="kwd">const</span><spanclass="pun">(</span><spanclass="typ">string</span><spanclass="pun">)</span></code></td><td>The path requested by user
127
134
</td>
128
135
</tr>
129
136
<tr>
@@ -145,13 +152,6 @@ <h1>Struct Request</h1><p>A request from user. Do not store ref to this struct a
<tdclass="typecol"><codeclass="prettyprint lang-d"><spanclass="kwd">const</span><spanclass="pun">(</span><spanclass="typ">string</span><spanclass="pun">[]</span><spanclass="pun">)</span></code></td><td>The sequence of endpoints called so far
<tdclass="typecol"><codeclass="prettyprint lang-d"><spanclass="kwd">const</span><spanclass="pun">(</span><spanclass="typ">string</span><spanclass="pun">)</span></code></td><td>The uri requested by user
0 commit comments