You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2015/11/18 18:12:30 UTC
[2/2] camel git commit: Use localhost in the example
Use localhost in the example
Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/8346b7bb
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/8346b7bb
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/8346b7bb
Branch: refs/heads/master
Commit: 8346b7bb99a30acbd4442699a1feb8d6bd0e2a01
Parents: f1dad83
Author: Claus Ibsen <da...@apache.org>
Authored: Wed Nov 18 18:03:06 2015 +0100
Committer: Claus Ibsen <da...@apache.org>
Committed: Wed Nov 18 18:12:23 2015 +0100
----------------------------------------------------------------------
.../java/org/apache/camel/example/cdi/UserRouteBuilder.java | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/camel/blob/8346b7bb/examples/camel-example-swagger-cdi/src/main/java/org/apache/camel/example/cdi/UserRouteBuilder.java
----------------------------------------------------------------------
diff --git a/examples/camel-example-swagger-cdi/src/main/java/org/apache/camel/example/cdi/UserRouteBuilder.java b/examples/camel-example-swagger-cdi/src/main/java/org/apache/camel/example/cdi/UserRouteBuilder.java
index c746082..da88910 100644
--- a/examples/camel-example-swagger-cdi/src/main/java/org/apache/camel/example/cdi/UserRouteBuilder.java
+++ b/examples/camel-example-swagger-cdi/src/main/java/org/apache/camel/example/cdi/UserRouteBuilder.java
@@ -19,6 +19,7 @@ package org.apache.camel.example.cdi;
import org.apache.camel.builder.RouteBuilder;
import org.apache.camel.cdi.ContextName;
import org.apache.camel.model.rest.RestBindingMode;
+import org.apache.camel.model.rest.RestHostNameResolver;
import static org.apache.camel.model.rest.RestParamType.body;
import static org.apache.camel.model.rest.RestParamType.path;
@@ -34,11 +35,13 @@ public class UserRouteBuilder extends RouteBuilder {
// configure we want to use servlet as the component for the rest DSL
// and we enable json binding mode
- restConfiguration().component("netty4-http").bindingMode(RestBindingMode.json)
+ restConfiguration().component("netty4-http")
+ // use json binding mode so Camel automatic binds json <--> pojo
+ .bindingMode(RestBindingMode.json)
// and output using pretty print
.dataFormatProperty("prettyPrint", "true")
- // setup context path and port number that netty will use
- .contextPath("/").port(8080)
+ // setup context path on localhost and port number that netty will use
+ .contextPath("/").host("localhost").port(8080)
// add swagger api-doc out of the box
.apiContextPath("/api-doc")
.apiProperty("api.title", "User API").apiProperty("api.version", "1.2.3")