Skip to content

Commit

Permalink
Fix types when creating a new connect hub in the recommended way.
Browse files Browse the repository at this point in the history
  • Loading branch information
ernestoalejo committed Mar 24, 2024
1 parent f88443a commit 30146b9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions apis.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ import (

// ConnectHub helps mounting Connect APIs to their correct endpoints.
type ConnectHub struct {
r *routing.Router
r *Router
cors []string
interceptors []connect.Interceptor
}

// NewConnectHub creates a new hub prepared to mount Connect APIs.
func NewConnectHub(r *routing.Router, opts ...ConnectHubOption) *ConnectHub {
func NewConnectHub(r *Router, opts ...ConnectHubOption) *ConnectHub {
hub := &ConnectHub{
r: r,
cors: []string{"https://studio.buf.build"},
Expand Down Expand Up @@ -57,7 +57,7 @@ func (hub *ConnectHub) Mount(fn MountFn) {
}
handler = cors.New(cnf).Handler(handler)
}
hub.r.PathPrefixHandler(pattern, routing.NewHandlerFromHTTP(handler))
hub.r.PathPrefixHandlerHTTP(pattern, handler)
}

func (hub *ConnectHub) opts() []connect.HandlerOption {
Expand Down

0 comments on commit 30146b9

Please sign in to comment.