Skip to content

Instantly share code, notes, and snippets.

@chamook
Created April 5, 2019 09:18
Show Gist options
  • Save chamook/ca30fd8c32f0e9563e7713fc047e94fb to your computer and use it in GitHub Desktop.
Save chamook/ca30fd8c32f0e9563e7713fc047e94fb to your computer and use it in GitHub Desktop.
type Colour = {
Id : string
Name : string
Hex : string
RGB : RGB
HSL : HSL
}
and RGB = { Red : int; Green : int; Blue : int }
and HSL = { Hue : int; Saturation : int; Lightness : int }
type MyColoursDto = { Colours : Colour list }
let myColours = [
{ Id = "abc123"
Name = "Red"
Hex = "#FF0000"
RGB = { Red = 255; Green = 0; Blue = 0 }
HSL = { Hue = 0; Saturation = 100; Lightness = 50 } }
{ Id = "def456"
Name = "Yellow"
Hex = "#FFFF00"
RGB = { Red = 255; Green = 255; Blue = 0 }
HSL = { Hue = 60; Saturation = 100; Lightness = 50 } }
]
let webApp =
choose [
route "/health" >=> Successful.OK "Everything's fine here, how are you?"
route "/my-colours" >=> Successful.OK { Colours = myColours } ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment