Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unintended serving #4

Open
jerbaroo opened this issue Jul 11, 2017 · 0 comments
Open

Unintended serving #4

jerbaroo opened this issue Jul 11, 2017 · 0 comments

Comments

@jerbaroo
Copy link

It is possible to serve an unintended endpoint without any compiler warning.

Should be mentioned in the README, or if possible throw a compile-time error! 😄

Example:

handler :: Server API
handler = fromNamed $
        Named @"b" := return "secretcode: 1234"
  ::<|> Named @"a" := return "foobar"
  ::<|> Nil

type API = FromNamed (
        Named "b" := "foobar" :> Get '[JSON] String
  ::<|> Named "b" := "secretcode" :> Get '[JSON] String
  ::<|> Nil )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant