From a2ff74f8db808c14a40dd5e98c42027320e7d0ef Mon Sep 17 00:00:00 2001 From: Pim Brouwers Date: Tue, 12 Dec 2023 06:17:09 -0500 Subject: [PATCH] web_host documentation --- docs/docs/host.html | 26 +++++++++++++++++++++++++- documentation/host.md | 27 ++++++++++++++++++++++++++- 2 files changed, 51 insertions(+), 2 deletions(-) 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 @@

Config, Logging & Other Operations< Configure the host via IHostBuilder. +web_host +Configure the host via IHostBuilder. + + logging Configure logging via ILoggingBuilder. @@ -107,7 +111,7 @@

Config, Logging & Other Operations< -

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