Created
April 1, 2015 05:18
-
-
Save kmels/f9d9eb2cf5eeaaf14a76 to your computer and use it in GitHub Desktop.
Suave index
This file contains hidden or 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
| 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