Skip to content

Commit 0df7c87

Browse files
author
arun
committed
Updated documentation.
1 parent 534d071 commit 0df7c87

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

README.rst

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,16 @@ Example: A simple HTTP service that responds to the ``/v1/ping`` endpoint can be
5151
}
5252
5353
// Setup HTTP service and add Handlers
54-
NettyHttpService service = NettyHttpService.builder()
54+
55+
// You can either add varargs of HttpHandler or as a list of HttpHanlders as below to the NettyService Builder
56+
57+
List<HttpHandler> handlers = new ArrayList<>();
58+
handlers.add(new PingHandler());
59+
handlers.add(...otherHandler...)
60+
61+
NettyHttpService service = NettyHttpService.builder("Name_of_app")
5562
.setPort(7777) // Optionally set the port. If unset, it will bind to an ephemeral port
56-
.addHttpHandlers(new PingHandler())
63+
.setHttpHandlers(handlers)
5764
.build();
5865
5966
// Start the HTTP service
@@ -140,9 +147,16 @@ Example: Sample HTTP service that manages an application lifecycle:
140147
}
141148
142149
// Setup HTTP service and add Handlers
143-
NettyHttpService service = NettyHttpService.builder()
150+
151+
// You can either add varargs of HttpHandler or as a list of HttpHanlders as below to the NettyService Builder
152+
153+
List<HttpHandler> handlers = new ArrayList<>();
154+
handlers.add(new PingHandler());
155+
handlers.add(...otherHandler...)
156+
157+
NettyHttpService service = NettyHttpService.builder("Name_of_app")
144158
.setPort(7777)
145-
.addHttpHandlers(new ApplicationHandler())
159+
.setHttpHandlers(handlers)
146160
.build();
147161
148162
// Start the HTTP service

0 commit comments

Comments
 (0)