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

Huma not respecting API Gateway path? #906

Closed
bclements opened this issue Mar 12, 2024 · 1 comment
Closed

Huma not respecting API Gateway path? #906

bclements opened this issue Mar 12, 2024 · 1 comment

Comments

@bclements
Copy link

bclements commented Mar 12, 2024

This may be a user error on my part so please bear with me.

We are using AWS api gateway that points to our chi service.

apigw.domain.com/blogs -> blogs.domain.com

When we go to any endpoint hosted by our service using the apigw, example apigw.domain.com/blogs/new we get a not found error and the path dev tools says can be found is apigw.domain.com/new ....Looks ilke the chi router is not respecting the original path.

Is there a way to configure chi to respect the path used by the apigw?

Any advice or a hint about where to start looking?

@pkieltyka
Copy link
Member

definitely a user problem

I'm not sure clear what the route mapping you're attempting to do.. but keep in mind the routing rules..

r.Handle("/blog/*", someHandler)

or ..

r.Handle("/*", someHandler)

... I'd suggest to just look at how the request is hitting the chi service, print the r.URL.Path and check what is actually hitting chi, then make sure you build a routing rule for it on chi's side, ie.

r.Handle("/new", handler), or r.Handle("/blog/new", handler), etc..

it sounds like you want the aws gateway to forward /blogs/* to a direct subdomain, so make sure your aws gateway is configured properly, that is likely another problem

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