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 subdomain routing #720

Open
wants to merge 18 commits into
base: main
Choose a base branch
from

Conversation

AlecDivito
Copy link

Adds support for routing on subdomains.

Description

Look at issue #690.

Motivation and Context

I needed support for routing on subdomains inside of my project.

How Has This Been Tested?

New tests have been added into the /tests/namespace.rs file.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • [] Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • Added example of new feature

@Fishrock123
Copy link
Member

@jbr Had a direction idea on this that wasn't posted to the original issue which I personally think is much better and more powerful than .subdomain().

It's possible that idea may not work out or may not materialize, but I think we should either consider waiting or consider that this api may later be dropped.

@AlecDivito
Copy link
Author

AlecDivito commented Oct 9, 2020

Yes, he actually posted his idea inside of issue #690 but then soon deleted it. Though i still have his response. He proposed doing routing using the entire url like so:

app.at("/path/still/works").get();
app.at("http://*/only-http").get();
app.at("//example.com/any-scheme/but-only-example.com").get();

I agree that this would be a lot more powerful but I also think that it would also be a lot more work. I just assumed that because he deleted his comment it wasn't being considered anymore.

@joshtriplett
Copy link
Member

I would love to have support for this, as well.

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