Skip to content

Instantly share code, notes, and snippets.

@panesofglass
Created February 24, 2011 23:14
Show Gist options
  • Select an option

  • Save panesofglass/843096 to your computer and use it in GitHub Desktop.

Select an option

Save panesofglass/843096 to your computer and use it in GitHub Desktop.
Options for Frank routing
let myApp = function
| GET "/" _ -> render "Hello world!"
| POST "/order" p -> frank {
createThingFromParams p
do! redirectTo "/" }
let myApp = App [
get "/" (render "Hello world!")
post "/order" (frank {
let! p = getParams
createThingFromParams p
do! redirectTo "/" })
]
let myApp = function
| GET "/" -> render "Hello world!"
| POST "/order" -> frank {
let! p = getParams
createThingFromParams p
do! redirectTo "/" }
@panesofglass
Copy link
Copy Markdown
Author

Added GET("/", _) -> ...at one point, but I think the active pattern is correct as is for the explicit param version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment