Skip to content

add host-based routing docs#1313

Merged
aminalaee merged 9 commits intoKludex:masterfrom
WhiteApfel:host-routing-docs
Oct 25, 2021
Merged

add host-based routing docs#1313
aminalaee merged 9 commits intoKludex:masterfrom
WhiteApfel:host-routing-docs

Conversation

@WhiteApfel
Copy link
Contributor

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 🤡

@WhiteApfel WhiteApfel requested a review from aminalaee October 19, 2021 17:55
Copy link
Contributor

@aminalaee aminalaee left a 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?

@WhiteApfel
Copy link
Contributor Author

There are several ways to connect host-based routes to your application

It'll do? I think that this does not make much sense, because the meaning from the upper sections is duplicated

@aminalaee
Copy link
Contributor

That makes sense.

@aminalaee aminalaee changed the title 📝 Docs: add host-based routing example add host-based routing docs Oct 25, 2021
Copy link
Contributor

@aminalaee aminalaee left a 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.

@aminalaee aminalaee merged commit d87c93e into Kludex:master Oct 25, 2021
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.

2 participants