Closed tahadostifam closed 2 weeks ago
Connect-go does support any router that implements the net/http Handler method. For example in the docs for routing the generated handler return the route prefix and a http.Handler
which can be directly passed to a server mux. See the generated NewPingServiceHandler
for reference to the type signature. Closing, but feel free to ask more questions about specific routers.
So is there any solution to handle my connectrpc
with gin?
Sorry but i'm a little confused😅
For gin
use the WrapH
to register to the gin handler. This will look something like:
router := gin.Default()
pingServiceRoute, pingServiceHandler := pingv1connect.NewPingServiceHandler()
router.POST(pingServiceRoute, gin.WrapH(pingServiceHandler))
I got it. Thank you so much Edward😄❤️🤌🏿
Hi, Recently i've been using
connectrpc
to handle myjson-rpc gateway
and i realizedconnectrpc
does not support nonhttp.ServeMux
router, right?Let me know i'm wrong!