Created
April 15, 2019 12:25
-
-
Save chamook/f1626e01695346289d5f099e3544ec31 to your computer and use it in GitHub Desktop.
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
type Price = { ItemId: string; Price: Decimal } | |
let getPriceForItem itemId : HttpHandler = | |
match itemId with | |
| "1" -> { ItemId = "1"; Price = 2.00M } |> Successful.OK | |
| "2" -> { ItemId = "2"; Price = 4.50M } |> Successful.OK | |
| _ -> RequestErrors.NOT_FOUND () | |
let webApp = | |
choose [ | |
routef "/item/%s/price" getPriceForItem | |
route "/health" >=> Successful.OK "Everything's fine here, how are you?" ] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment