Suave is a simple web development F# library providing a lightweight web server and a set of combinators to manipulate route flow and task composition.
ademar on master
Corrected default port from 808… Merge pull request #723 from Wa… (compare)
I'm a suave and f# beginner having a question: Why do you want to run a Suave as a .fsx script and why not as a .fs?
I've gone down the .fs road but I got stuck trying to get Suave to work in my app together with docker... "Console.ReadKey true |> ignore" doesn't seem to work in a Docker environment for some reason and without it my Suave app just exits immediately. Any tips?
@ademar Thanks for the tip. I've basically only copied the code on the suave introduction page: https://suave.io/index.html
open System
open System.Threading
open Suave
[<EntryPoint>]
let main argv =
let cts = new CancellationTokenSource()
let conf = { defaultConfig with cancellationToken = cts.Token }
let listening, server = startWebServerAsync conf (Successful.OK "Hello World")
Async.Start(server, cts.Token)
printfn "Make requests now"
Console.ReadKey true |> ignore
cts.Cancel()
0 // return an integer exit code
but if I remove Console.ReadKey it becomes nonblocking.
Is the key not to use startWebServerAsync
and rather use startWebServer
as u mentioned?
<input type="hidden" id="custId" name="custId" value="3487">