diff --git a/docs/docs/host.html b/docs/docs/host.html index 5b74193..3649238 100644 --- a/docs/docs/host.html +++ b/docs/docs/host.html @@ -98,6 +98,10 @@
IHostBuilder
.IHostBuilder
.ILoggingBuilder
.logging
host
open Falco
open Falco.Routing
open Falco.HostBuilder
@@ -126,6 +130,26 @@ logging
]
}
+web_host
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
open Falco
open Falco.Routing
open Falco.HostBuilder
diff --git a/documentation/host.md b/documentation/host.md
index 16f141b..63df7a0 100644
--- a/documentation/host.md
+++ b/documentation/host.md
@@ -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
@@ -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