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

Add Host API combinator #1800

Open
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

Daniel-Diaz
Copy link
Contributor

This combinator allows you to select or restrict APIs according to the provided hosts. For example:

type API = Host "api1.example" :> API1
      :<|> Host "api2.example" :> API2

I implemented it as far as it was needed to make it work, i.e. adding HasClient and HasServer instances. If you want me to add support in more places, let me know.

@arianvp
Copy link
Member

arianvp commented Jan 11, 2025

Great idea.

@tchoutri tchoutri self-requested a review January 14, 2025 09:01
@tchoutri
Copy link
Contributor

@Daniel-Diaz Hi! Thanks for the contribution. Would you mind rebase your branch on the current master? :)

@Daniel-Diaz
Copy link
Contributor Author

@Daniel-Diaz Hi! Thanks for the contribution. Would you mind rebase your branch on the current master? :)

I think I did. Does it look ok?

@tchoutri
Copy link
Contributor

@Daniel-Diaz Fantastic. Would you mind adding it to the test suite? Right here: https://github.com/haskell-servant/servant/blob/master/servant-client/test/Servant/ClientTestUtils.hs#L223

@Daniel-Diaz
Copy link
Contributor Author

@Daniel-Diaz Fantastic. Would you mind adding it to the test suite? Right here: https://github.com/haskell-servant/servant/blob/master/servant-client/test/Servant/ClientTestUtils.hs#L223

I added an entry to the testing API referenced here.

@tchoutri
Copy link
Contributor

@Daniel-Diaz Excellent, thank you. Would you mind adding a changelog entry like this one?

@Daniel-Diaz
Copy link
Contributor Author

@Daniel-Diaz Excellent, thank you. Would you mind adding a changelog entry like this one?

I just added the changelog file. Let me know if it looks correct.

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

Successfully merging this pull request may close these issues.

3 participants