Created
July 24, 2018 11:33
-
-
Save kunjee17/8a7820508cdaecf172fae03123ca2467 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment