Skip to content

Instantly share code, notes, and snippets.

@nicklanng
Created July 2, 2015 14:02
Show Gist options
  • Save nicklanng/d02fcbd9d6031481015b to your computer and use it in GitHub Desktop.
Save nicklanng/d02fcbd9d6031481015b to your computer and use it in GitHub Desktop.
Websharper
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