-
Notifications
You must be signed in to change notification settings - Fork 107
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
Allowed pass mux interface to handler #304
Comments
Thanks for the detailed examples, @tsingson! We definitely want You can use
Or, if you prefer:
|
Thanks for the quick reply and code example. I'm integrating connect-go into my project ( to replace drpc, another good one RPC ) , and go some performance testting. So far, it's working well. thanks Buf team, great work on GRPC!! |
I just wanted to post this here in case someone else gets stuck like I did. If your connect routes aren't handled from the root r := chi.NewRouter()
route, handler := pingv1connect.NewPingServiceHandler(&ExamplePingServer{})
r.Handle(route+"*", http.StripPrefix("/api", handler)) I was confused on why I was getting a 404 when clearly the route existed, but I didn't realize that the generated handlers return 404 if if url path isn't an exact match, hence the need to strip the prefix. Hope this helps someone. |
Is your feature request related to a problem? Please describe.
make it easy to replace http.ServeMux to another mux / router that 100% compatible with net/http
like this one: https://github.com/go-chi/chi
mux interface like this:
and other golang router is easy to wrap the interface via POST handler ( connect-go only use POST )
like this issue https://github.com/bufbuild/connect-go/issues/258
Describe the solution you'd like
from
to
impl
if this suggest ok, it's easy to change the function below:
1. add new file in connect-go repo
change this func
to
then rebuild the plugins
then , re-generate
it's work like
test pass
The text was updated successfully, but these errors were encountered: