cmd/server/main.go (view raw)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
package main import ( "fmt" "net/http" "github.com/wbrijesh/trying-trpc/internal/haberdasherserver" "github.com/wbrijesh/trying-trpc/rpc/haberdasher" ) func main() { server := &haberdasherserver.Server{} // implements Haberdasher interface twirpHandler := haberdasher.NewHaberdasherServer(server) err := http.ListenAndServe(":8080", twirpHandler) if err != nil { fmt.Println("Error starting server: ", err) return } } |