Skip to content

Instantly share code, notes, and snippets.

@kmels
Created April 1, 2015 05:18
Show Gist options
  • Select an option

  • Save kmels/f9d9eb2cf5eeaaf14a76 to your computer and use it in GitHub Desktop.

Select an option

Save kmels/f9d9eb2cf5eeaaf14a76 to your computer and use it in GitHub Desktop.
Suave index
module Main
open Suave // always open suave
open Suave.Http.Successful // for OK-result
open Suave.Web // for config
open Suave.Http
open Suave.Http.Applicatives
open Suave.Http.Successful
open Suave.Web
open System
open System.IO
let index () : string =
let reader = new StreamReader("index.html")
reader.ReadToEnd()
let app =
choose
[ GET >>= choose
[ path "/hello" >>= OK (index ()) ] ]
[<EntryPoint>]
let main args =
startWebServer defaultConfig app
0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment