- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 971
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-based routing docs #1313
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
...
routes = [
Host('api.example.org', api)
]
app = Starlette(routes=routes)
app.host('www.example.org', site)
news_host = Host('news.example.org', news)
app.router.routes.append(news_host)
I think this is much better. Do you think we may need a little explanation here?
It'll do? I think that this does not make much sense, because the meaning from the upper sections is duplicated |
That makes sense. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this.
Yesterday I wanted to use host-based routing, saw the necessary methods in the Starlette class, but did not find any info in docs. After searching, I found #363 and decided to add at least a minimal mention of host-based routing to the documentation.
#369 opened almost three years ago and is still open 🤡