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

experimental path based routing #71

Merged
merged 1 commit into from
Sep 13, 2016
Merged

experimental path based routing #71

merged 1 commit into from
Sep 13, 2016

Conversation

mikz
Copy link
Contributor

@mikz mikz commented Sep 13, 2016

implements #22

  • try to match the service host and mapping rules to determine which service to use

@tnscorcoran after merging this you'll be able to start the gateway with APICAST_PATH_ROUTING_ENABLED environment variable set to whatever to enable this feature.

It will allow you to have two services with the same host, but still route to the one that matches the rules.

So if you have services A and B both with host 'api.example.com' where
A matches GET /a
and B matches GET /b

you'll be able to make requests:

GET /a
Host: api.example.com
GET /b
Host: api.example.com

just fine and they'll be routed to the appropriate service.

/cc @vramosp correct me if I'm not explaining it clearly

1. match services by host
2. when host matches, try to match mapping rules
3. if no services match both host and mapping rules
4. fallback to matching by host
@mikz mikz merged commit f8ba585 into v2 Sep 13, 2016
@mikz mikz deleted the path-routing branch September 13, 2016 15:53
@mikz mikz removed the in progress label Sep 13, 2016
@vramosp
Copy link

vramosp commented Sep 13, 2016

👍

cc @VinayBhalerao

@VinayBhalerao
Copy link
Contributor

Forget to comment here earlier. Tested and looks good to me.

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.

None yet

3 participants