Skip to content

Instantly share code, notes, and snippets.

@codedmart
Created May 11, 2015 19:22
Show Gist options
  • Select an option

  • Save codedmart/0aca0ed097840852159c to your computer and use it in GitHub Desktop.

Select an option

Save codedmart/0aca0ed097840852159c to your computer and use it in GitHub Desktop.
type AuthTokenAPI =
WithAuthToken :> (
"private" :> Get String
:<|> "private" :> Post String
)
api :: Proxy API
api = Proxy
authTokenServer :: Pool DBHandle -> Server AuthTokenAPI
authTokenServer h =
(checkAuth,
getPrivate
:<|> postPrivate
)
where
getPrivate = return "Private Get"
postPrivate = return "Private Post"
checkAuth :: TokenLookup
checkAuth = checkAuthToken h
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment