Skip to content

Commit

Permalink
web_host documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
pimbrouwers committed Dec 12, 2023
1 parent 1079115 commit a2ff74f
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 2 deletions.
26 changes: 25 additions & 1 deletion docs/docs/host.html
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,10 @@ <h2 id="config-logging-other-operations">Config, Logging &amp; Other Operations<
<td>Configure the host via <code>IHostBuilder</code>.</td>
</tr>
<tr>
<td><a href="#web_host">web_host</a></td>
<td>Configure the host via <code>IHostBuilder</code>.</td>
</tr>
<tr>
<td><a href="#logging">logging</a></td>
<td>Configure logging via <code>ILoggingBuilder</code>.</td>
</tr>
Expand All @@ -107,7 +111,7 @@ <h2 id="config-logging-other-operations">Config, Logging &amp; Other Operations<
</tr>
</tbody>
</table>
<h3 id="logging"><code>logging</code></h3>
<h3 id="host"><code>host</code></h3>
<pre><code class="language-fsharp">open Falco
open Falco.Routing
open Falco.HostBuilder
Expand All @@ -126,6 +130,26 @@ <h3 id="logging"><code>logging</code></h3>
]
}
</code></pre>
<h3 id="web_host"><code>web_host</code></h3>
<pre><code class="language-fsharp">open Falco
open Falco.Routing
open Falco.HostBuilder
open Microsoft.Extensions.Hosting
open Serilog

let configureWebHost (webHost : IWebHostBuilder) =
webHost.UseHttpSys()
webHost

webHost [||] {
web_host configureWebHost

endpoints [
get &quot;/&quot; (Response.ofPlainText &quot;Hello world&quot;)
]
}
</code></pre>
<h3 id="logging"><code>logging</code></h3>
<pre><code class="language-fsharp">open Falco
open Falco.Routing
open Falco.HostBuilder
Expand Down
27 changes: 26 additions & 1 deletion documentation/host.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ The `webHost[||] { ... }` computation aims to provide a consistent methodology f
| Operation | Description |
| --------- | ----------- |
| [host](#host) | Configure the host via `IHostBuilder`. |
| [web_host](#web_host) | Configure the host via `IHostBuilder`. |
| [logging](#logging) | Configure logging via `ILoggingBuilder`. |
| [not_found](#not_found) | Include a catch-all (i.e., Not Found) HttpHandler (must be added last). |

### `logging`
### `host`

```fsharp
open Falco
Expand All @@ -32,6 +33,30 @@ webHost [||] {
}
```

### `web_host`

```fsharp
open Falco
open Falco.Routing
open Falco.HostBuilder
open Microsoft.Extensions.Hosting
open Serilog
let configureWebHost (webHost : IWebHostBuilder) =
webHost.UseHttpSys()
webHost
webHost [||] {
web_host configureWebHost
endpoints [
get "/" (Response.ofPlainText "Hello world")
]
}
```

### `logging`

```fsharp
open Falco
open Falco.Routing
Expand Down

0 comments on commit a2ff74f

Please sign in to comment.