aboutsummaryrefslogtreecommitdiff
path: root/README.md
diff options
context:
space:
mode:
authorAlexander Kiryukhin <a.kiryukhin@mail.ru>2022-05-28 16:53:20 +0300
committerAlexander Kiryukhin <a.kiryukhin@mail.ru>2022-05-28 16:53:20 +0300
commitf304a07a8cfe67b2a65f95f27eb10a9b854c4ef8 (patch)
tree9e6a7e9ea6b8d600cccac5a5d50f3232d631d073 /README.md
parent281eda83c9f4bcb06318444df3574df0840205fa (diff)
Improved middlewares
Diffstat (limited to 'README.md')
-rw-r--r--README.md3
1 files changed, 2 insertions, 1 deletions
diff --git a/README.md b/README.md
index 8819880..6aa66ca 100644
--- a/README.md
+++ b/README.md
@@ -78,6 +78,7 @@ import (
"context"
"go.neonxp.dev/jsonrpc2/rpc"
+ "go.neonxp.dev/jsonrpc2/rpc/middleware"
"go.neonxp.dev/jsonrpc2/transport"
)
@@ -90,7 +91,7 @@ func main() {
// Set options after constructor
s.Use(
rpc.WithTransport(&transport.TCP{Bind: ":3000"}), // TCP transport
- rpc.WithMiddleware(rpc.LoggerMiddleware(rpc.StdLogger)), // Logger middleware
+ rpc.WithMiddleware(middleware.Logger(rpc.StdLogger)), // Logger middleware
)
s.Register("multiply", rpc.H(Multiply))