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

Code example #7

Open
bynelus opened this issue Oct 5, 2024 · 1 comment
Open

Code example #7

bynelus opened this issue Oct 5, 2024 · 1 comment

Comments

@bynelus
Copy link

bynelus commented Oct 5, 2024

Would it be possible to add a code example on how to implement this HostRouter?

@dimitribouniol
Copy link
Member

dimitribouniol commented Dec 22, 2024

Sorry for the very late reply here (I had notifications off for some reason), but you use it just like you use existing routes in your vapor app:

let publicHost = app.grouped(host: "jiiiii.moe")
let apiHost = app.grouped(host: "api.jiiiii.moe")

publicHost.get("hello") { request in "Hello jiiiii.moe" }
apiHost.get("hello") { request in "Hello api.jiiiii.moe" }

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

2 participants