Skip to content

Instantly share code, notes, and snippets.

@Tarmil
Last active May 25, 2018 08:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tarmil/31d6b51875e7ad7b1ae1c5fc52ac8daf to your computer and use it in GitHub Desktop.
Save Tarmil/31d6b51875e7ad7b1ae1c5fc52ac8daf to your computer and use it in GitHub Desktop.
type User = { name: string; (* ... *) }
type UserId = int
type EndPoint<_> =
| [<EndPoint "GET /user/{id}">]
GetUser : id: UserId -> EndPoint<Json<User>>
| [<EndPoint "POST /user"; Json "userData">]
CreateUser : userData: User -> EndPoint<Json<UserId>>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment