From 25e19d9c548004340fd4e2336754bcae2c0c20b0 Mon Sep 17 00:00:00 2001 From: Javad Date: Sat, 8 Jun 2024 13:48:00 +0330 Subject: [PATCH] docs: update create example --- README.md | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 95f28c5..5bc46c0 100644 --- a/README.md +++ b/README.md @@ -76,22 +76,15 @@ greeting := pb.NewGreetingServiceClient(grpcConn) greetingService := pb.NewGreetingServiceJsonRpcService(greeting) jgw := jrpc.NewServer() -jgw.RegisterServices(&greetingService) +jgw.RegisterServices(greetingService) // json-rpc listener lis, err = net.Listen("tcp", "localhost:8687") if err != nil { log.Fatalln(err) } -mux := http.NewServeMux() -mux.HandleFunc("/", jgw.HttpHandler) -server := &http.Server{ - Handler: mux, - Addr: lis.Addr().String(), - ReadHeaderTimeout: 3 * time.Second, -} -if err := server.Serve(lis); err != nil { +if err := jgw.Serve(lis); err != nil { log.Fatalln(err) } ```