Skip to content

Instantly share code, notes, and snippets.

@kunjee17
Created July 24, 2018 11:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save kunjee17/8a7820508cdaecf172fae03123ca2467 to your computer and use it in GitHub Desktop.
Save kunjee17/8a7820508cdaecf172fae03123ca2467 to your computer and use it in GitHub Desktop.
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