Created
July 2, 2015 14:02
-
-
Save nicklanng/d02fcbd9d6031481015b to your computer and use it in GitHub Desktop.
Websharper
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 WebSharper | |
open WebSharper.Html.Server | |
type Endpoints = | |
| [<EndPoint "GET /">] Home | |
| [<EndPoint "GET /about">] About | |
let MyApp = | |
Warp.CreateApplication (fun ctx endpoint -> | |
match endpoint with | |
| Endpoints.Home -> | |
Warp.Page( | |
Body = | |
[ | |
H1 [Text "Home!"] | |
] | |
) | |
| Endpoints.About -> | |
Warp.Page( | |
Body = | |
[ | |
H1 [Text "About!"] | |
] | |
) | |
) | |
[<EntryPoint>] | |
do Warp.RunAndWaitForInput(MyApp) |> ignore |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment