Java Code Examples for io.undertow.server.RoutingHandler

The following examples show how to use io.undertow.server.RoutingHandler. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source Project: SikuliX1   Source File: SikulixServer.java    License: MIT License 6 votes vote down vote up
private static Undertow createServer(int port, String ipAddr) {
  ControllerCommand controller = new ControllerCommand();
  TasksCommand tasks = new TasksCommand();
  ScriptsCommand scripts = new ScriptsCommand(tasks);
  GroupsCommand groups = new GroupsCommand(scripts);

  ResourceManager resourceManager = new ClassPathResourceManager(RunTime.class.getClassLoader(), "htdocs");
  ResourceHandler resource = new ResourceHandler(resourceManager, AbstractCommand.getFallbackHandler());
  resource.addWelcomeFiles("ControlBox.html");

  RoutingHandler commands = Handlers.routing()
          .addAll(controller.getRouting())
          .addAll(tasks.getRouting())
          .addAll(scripts.getRouting())
          .addAll(groups.getRouting())
          .setFallbackHandler(resource);
  CommandRootHttpHandler cmdRoot = new CommandRootHttpHandler(commands);
  cmdRoot.addExceptionHandler(Throwable.class, AbstractCommand.getExceptionHttpHandler());

  Undertow server = Undertow.builder()
          .addHttpListener(port, ipAddr)
          .setServerOption(UndertowOptions.RECORD_REQUEST_START_TIME, true)
          .setHandler(cmdRoot)
          .build();
  return server;
}
 
Example 2
Source Project: proteus   Source File: AssetsService.java    License: Apache License 2.0 6 votes vote down vote up
public RoutingHandler get()
{
    RoutingHandler router = new RoutingHandler();
    final String assetsPath = serviceConfig.getString("path");
    final String assetsDirectoryName = serviceConfig.getString("dir");
    final Integer assetsCacheTime = serviceConfig.getInt("cache.time");
    final FileResourceManager fileResourceManager = new FileResourceManager(Paths.get(assetsDirectoryName).toFile());

    router.add(Methods.GET,
            assetsPath + "/*",
            io.undertow.Handlers.rewrite("regex('" + assetsPath + "/(.*)')",
                    "/$1",
                    getClass().getClassLoader(),
                    new ResourceHandler(fileResourceManager).setCachable(TruePredicate.instance()).setCacheTime(assetsCacheTime)));

    this.registeredEndpoints.add(EndpointInfo.builder()
            .withConsumes("*/*")
            .withProduces("*/*")
            .withPathTemplate(assetsPath)
            .withControllerName(this.getClass().getSimpleName())
            .withMethod(Methods.GET)
            .build());

    return router;
}
 
Example 3
Source Project: proteus   Source File: HandlerGenerator.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Compiles the generated source into a new {@link Class}
 * @return a new {@code Supplier<RoutingHandler>} class
 */
public Class<? extends Supplier<RoutingHandler>> compileClass()
{
    try {
        this.generateRoutes();

        log.debug("\n\nGenerated Class Source:\n\n" + this.sourceString);

        return CompilerUtils.CACHED_COMPILER.loadFromJava(packageName + "." + className, this.sourceString);

    } catch (Exception e) {
        log.error(e.getMessage(), e);
        return null;
    }
}
 
Example 4
Source Project: light-rest-4j   Source File: JwtVerifyHandlerTest.java    License: Apache License 2.0 5 votes vote down vote up
static RoutingHandler getTestHandler() {
    return Handlers.routing()
            .add(Methods.GET, "/v1/pets/{petId}", exchange -> {
                Map<String, Object> examples = new HashMap<>();
                examples.put("application/xml", StringEscapeUtils.unescapeHtml4("&lt;Pet&gt;  &lt;id&gt;123456&lt;/id&gt;  &lt;name&gt;doggie&lt;/name&gt;  &lt;photoUrls&gt;    &lt;photoUrls&gt;string&lt;/photoUrls&gt;  &lt;/photoUrls&gt;  &lt;tags&gt;  &lt;/tags&gt;  &lt;status&gt;string&lt;/status&gt;&lt;/Pet&gt;"));
                examples.put("application/json", StringEscapeUtils.unescapeHtml4("{  &quot;photoUrls&quot; : [ &quot;aeiou&quot; ],  &quot;name&quot; : &quot;doggie&quot;,  &quot;id&quot; : 123456789,  &quot;category&quot; : {    &quot;name&quot; : &quot;aeiou&quot;,    &quot;id&quot; : 123456789  },  &quot;tags&quot; : [ {    &quot;name&quot; : &quot;aeiou&quot;,    &quot;id&quot; : 123456789  } ],  &quot;status&quot; : &quot;aeiou&quot;}"));
                if(examples.size() > 0) {
                    exchange.getResponseHeaders().add(new HttpString("Content-Type"), "application/json");
                    exchange.getResponseSender().send((String)examples.get("application/json"));
                } else {
                    exchange.endExchange();
                }
            })
            .add(Methods.GET, "/v1/pets", exchange -> exchange.getResponseSender().send("get"));
}
 
Example 5
Source Project: light-rest-4j   Source File: SwaggerHandlerTest.java    License: Apache License 2.0 5 votes vote down vote up
static RoutingHandler getTestHandler() {
    return Handlers.routing()
            .add(Methods.GET, "/get", exchange -> exchange.getResponseSender().send("get"))
            .add(Methods.POST, "/v2/pet", exchange -> {
                Map<String, Object> auditInfo = exchange.getAttachment(AttachmentConstants.AUDIT_INFO);
                if(auditInfo != null) {
                    exchange.getResponseSender().send("withAuditInfo");
                } else {
                    exchange.getResponseSender().send("withoutAuditInfo");
                }
            })
            .add(Methods.GET, "/v2/pet", exchange -> exchange.getResponseSender().send("get"));
}
 
Example 6
Source Project: light-rest-4j   Source File: JwtVerifyHandlerTest.java    License: Apache License 2.0 5 votes vote down vote up
static RoutingHandler getTestHandler() {
    return Handlers.routing()
            .add(Methods.GET, "/v2/pet/{petId}", exchange -> {
                Map<String, Object> examples = new HashMap<>();
                examples.put("application/xml", StringEscapeUtils.unescapeHtml4("&lt;Pet&gt;  &lt;id&gt;123456&lt;/id&gt;  &lt;name&gt;doggie&lt;/name&gt;  &lt;photoUrls&gt;    &lt;photoUrls&gt;string&lt;/photoUrls&gt;  &lt;/photoUrls&gt;  &lt;tags&gt;  &lt;/tags&gt;  &lt;status&gt;string&lt;/status&gt;&lt;/Pet&gt;"));
                examples.put("application/json", StringEscapeUtils.unescapeHtml4("{  &quot;photoUrls&quot; : [ &quot;aeiou&quot; ],  &quot;name&quot; : &quot;doggie&quot;,  &quot;id&quot; : 123456789,  &quot;category&quot; : {    &quot;name&quot; : &quot;aeiou&quot;,    &quot;id&quot; : 123456789  },  &quot;tags&quot; : [ {    &quot;name&quot; : &quot;aeiou&quot;,    &quot;id&quot; : 123456789  } ],  &quot;status&quot; : &quot;aeiou&quot;}"));
                if(examples.size() > 0) {
                    exchange.getResponseHeaders().add(new HttpString("Content-Type"), "application/json");
                    exchange.getResponseSender().send((String)examples.get("application/json"));
                } else {
                    exchange.endExchange();
                }
            })
            .add(Methods.GET, "/v2/pet", exchange -> exchange.getResponseSender().send("get"));
}
 
Example 7
Source Project: light-rest-4j   Source File: OpenApiHandlerTest.java    License: Apache License 2.0 5 votes vote down vote up
static RoutingHandler getTestHandler() {
    return Handlers.routing()
            .add(Methods.GET, "/pets", exchange -> exchange.getResponseSender().send("get"))
            .add(Methods.POST, "/v1/pets", exchange -> {
                Map<String, Object> auditInfo = exchange.getAttachment(AttachmentConstants.AUDIT_INFO);
                if(auditInfo != null) {
                    exchange.getResponseSender().send("withAuditInfo");
                } else {
                    exchange.getResponseSender().send("withoutAuditInfo");
                }
            })
            .add(Methods.DELETE, "/v1/pets", exchange -> exchange.getResponseSender().send("deleted"));
}
 
Example 8
Source Project: light-rest-4j   Source File: ValidatorHandlerTest.java    License: Apache License 2.0 5 votes vote down vote up
RoutingHandler getPetStoreHandler() {
    ForwardRequestHandler forwardHandler = new ForwardRequestHandler();
    return Handlers.routing()
            .add(Methods.POST, "/v1/pets", exchange -> exchange.getResponseSender().send("addPet"))
            .add(Methods.GET, "/v1/pets/{petId}", exchange -> exchange.getResponseSender().send("getPetById"))
            .add(Methods.DELETE, "/v1/pets/{petId}", exchange -> exchange.getResponseSender().send("deletePetById"))
            .add(Methods.GET, "/v1/todoItems", forwardHandler)
            .add(Methods.GET, "/v1/pets", exchange -> {
                if (exchange.getQueryParameters() != null && exchange.getQueryParameters().containsKey("arr")) {
                    exchange.getResponseSender().send("getPets" + ", the query parameter = " + exchange.getQueryParameters() + ", length = " + exchange.getQueryParameters().get("arr").size());
                } else {
                    exchange.getResponseSender().send("getPets");
                }
            });
}
 
Example 9
Source Project: StubbornJava   Source File: DelayedHandlerExample.java    License: MIT License 5 votes vote down vote up
private static HttpHandler getRouter() {

        // Handler using Thread.sleep for a blocking delay
        HttpHandler sleepHandler = (exchange) -> {
            log.debug("In sleep handler");
            Uninterruptibles.sleepUninterruptibly(1L, TimeUnit.SECONDS);
            Exchange.body().sendText(exchange, "ok");
        };

        // Custom handler using XnioExecutor.executeAfter
        // internals for a non blocking delay
        DelayedExecutionHandler delayedHandler = DiagnosticHandlers.fixedDelay(
            (exchange) -> {
                log.debug("In delayed handler");
                Exchange.body().sendText(exchange, "ok");
            },
            1L, TimeUnit.SECONDS);

        HttpHandler routes = new RoutingHandler()
            .get("/sleep", sleepHandler)
            .get("/dispatch/sleep", new BlockingHandler(sleepHandler))
            .get("/delay", delayedHandler)
            .get("/dispatch/delay", new BlockingHandler(delayedHandler))
            .setFallbackHandler(RoutingHandlers::notFoundHandler);

        return CustomHandlers.accessLog(routes, LoggerFactory.getLogger("Access Log"));
    }
 
Example 10
Source Project: light-4j   Source File: WhitelistHandlerTest.java    License: Apache License 2.0 5 votes vote down vote up
static RoutingHandler getTestHandler() {
    return Handlers.routing()
            .add(Methods.GET, "/data", exchange -> {
                exchange.getResponseSender().send("OK");
            })
            .add(Methods.GET, "/default", exchange -> {
                exchange.getResponseSender().send("OK");
            })
            .add(Methods.GET, "/health/com.networknt.petstore-1.0.0", exchange -> {
                exchange.getResponseSender().send("OK");
            });
}
 
Example 11
Source Project: light-4j   Source File: BodyStringCachingTest.java    License: Apache License 2.0 5 votes vote down vote up
static RoutingHandler getTestHandler() {
    return Handlers.routing()
            .add(Methods.POST, "/post", exchange -> {
                String bodyString = (String) exchange.getAttachment(BodyHandler.REQUEST_BODY_STRING);
                if (bodyString == null) {
                    exchange.getResponseSender().send("nobody");
                } else {
                    exchange.getResponseSender().send(bodyString);
                }
            });
}
 
Example 12
Source Project: light-4j   Source File: ExceptionHandlerTest.java    License: Apache License 2.0 5 votes vote down vote up
@SuppressWarnings("ConstantOverflow")
static RoutingHandler getTestHandler() {
    return Handlers.routing()
            .add(Methods.GET, "/normal", exchange -> exchange.getResponseSender().send("normal"))
            .add(Methods.GET, "/runtime", exchange -> {
                int i = 1/0;
            })
            .add(Methods.GET, "/api", exchange -> {
                Status error = new Status("ERR10001");
                throw new ApiException(error);
            })
            .add(Methods.GET, "/uncaught", exchange -> {
                String content = new Scanner(new File("djfkjoiwejjhh9032d")).useDelimiter("\\Z").next();
            });
}
 
Example 13
Source Project: light-4j   Source File: ContentHandlerTest.java    License: Apache License 2.0 5 votes vote down vote up
static RoutingHandler getTestHandler() {
  return Handlers.routing()
    .add(Methods.GET, "/", exchange -> {
      exchange.getResponseSender().send("This is just a proof");
    })
    .add(Methods.GET, "/xml", exchange -> {
      exchange
        .getResponseSender()
        .send("<bookstore><book><title>The best of Light-4j</title>" +
          "<author>Steve Hu</author><year>2018</year></book></bookstore>");
    })
    .add(Methods.GET, "/json", exchange -> {
      exchange.getResponseSender().send("{\"bookstore\":{\"book\":{\"title\":\"The best of Light-4j\",\"author\":\"Steve Hu\"}}}");
    });
}
 
Example 14
Source Project: light-4j   Source File: HeaderHandlerTest.java    License: Apache License 2.0 5 votes vote down vote up
static RoutingHandler getTestHandler() {
    return Handlers.routing()
            .add(Methods.GET, "/get", exchange -> {
                Map<String, Map<String, String>> headers = new HashMap<>();
                Map<String, String> requestHeaders = new HashMap<>();
                String header1 = exchange.getRequestHeaders().getFirst("header1");
                if(header1 != null) requestHeaders.put("header1", header1);
                String header2 = exchange.getRequestHeaders().getFirst("header2");
                if(header2 != null) requestHeaders.put("header2", header1);
                String key1 = exchange.getRequestHeaders().getFirst("key1");
                if(key1 != null) requestHeaders.put("key1", key1);
                String key2 = exchange.getRequestHeaders().getFirst("key2");
                if(key2 != null) requestHeaders.put("key2", key2);
                headers.put("requestHeaders", requestHeaders);

                Map<String, String> responseHeaders = new HashMap<>();
                header1 = exchange.getResponseHeaders().getFirst("header1");
                if(header1 != null) responseHeaders.put("header1", header1);
                header2 = exchange.getResponseHeaders().getFirst("header2");
                if(header2 != null) responseHeaders.put("header2", header1);
                key1 = exchange.getResponseHeaders().getFirst("key1");
                if(key1 != null) responseHeaders.put("key1", key1);
                key2 = exchange.getResponseHeaders().getFirst("key2");
                if(key2 != null) responseHeaders.put("key2", key2);
                headers.put("responseHeaders", responseHeaders);
                exchange.getResponseSender().send(Config.getInstance().getMapper().writeValueAsString(headers));
            });
}
 
Example 15
Source Project: light-4j   Source File: CorsHttpHandlerTest.java    License: Apache License 2.0 5 votes vote down vote up
static RoutingHandler getTestHandler() {
    return Handlers.routing()
            .add(Methods.GET, "/", exchange -> {
                exchange.getResponseSender().send("OK");
            })
            .add(Methods.POST, "/", exchange -> {
                exchange.getResponseSender().send("OK");
            });
}
 
Example 16
Source Project: light-4j   Source File: LimitHandlerTest.java    License: Apache License 2.0 5 votes vote down vote up
static RoutingHandler getTestHandler() {
    return Handlers.routing()
            .add(Methods.GET, "/", exchange -> {
                try {
                    Thread.sleep(500);
                } catch (InterruptedException e) {

                }
                exchange.getResponseSender().send("OK");
            });
}
 
Example 17
Source Project: StubbornJava   Source File: DelayedHandlerExample.java    License: MIT License 5 votes vote down vote up
private static HttpHandler getRouter() {

        // Handler using Thread.sleep for a blocking delay
        HttpHandler sleepHandler = (exchange) -> {
            log.debug("In sleep handler");
            Uninterruptibles.sleepUninterruptibly(1L, TimeUnit.SECONDS);
            Exchange.body().sendText(exchange, "ok");
        };

        // Custom handler using XnioExecutor.executeAfter
        // internals for a non blocking delay
        DelayedExecutionHandler delayedHandler = DiagnosticHandlers.fixedDelay(
            (exchange) -> {
                log.debug("In delayed handler");
                Exchange.body().sendText(exchange, "ok");
            },
            1L, TimeUnit.SECONDS);

        HttpHandler routes = new RoutingHandler()
            .get("/sleep", sleepHandler)
            .get("/dispatch/sleep", new BlockingHandler(sleepHandler))
            .get("/delay", delayedHandler)
            .get("/dispatch/delay", new BlockingHandler(delayedHandler))
            .setFallbackHandler(RoutingHandlers::notFoundHandler);

        return CustomHandlers.accessLog(routes, LoggerFactory.getLogger("Access Log"));
    }
 
Example 18
Source Project: skywalking   Source File: RootHandlerInterceptor.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
    MethodInterceptResult result) throws Throwable {
    int handlerIndex = allArguments.length - 1;
    if (!(allArguments[handlerIndex] instanceof RoutingHandler)) {
        allArguments[handlerIndex] = new TracingHandler((HttpHandler) allArguments[handlerIndex]);
    }
}
 
Example 19
Source Project: skywalking   Source File: ListenerConfigInterceptor.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public void beforeMethod(EnhancedInstance objInst, Method method, Object[] allArguments, Class<?>[] argumentsTypes,
    MethodInterceptResult result) throws Throwable {
    final Undertow.ListenerBuilder builder = (Undertow.ListenerBuilder) allArguments[0];
    final Field rootHandlerField = Undertow.ListenerBuilder.class.getDeclaredField("rootHandler");
    rootHandlerField.setAccessible(true);
    final Object handler = rootHandlerField.get(builder);
    if (null != handler && !(handler instanceof RoutingHandler)) {
        rootHandlerField.set(builder, new TracingHandler((HttpHandler) handler));
    }
}
 
Example 20
@Test
public void testMatchRoutingHandler() throws Throwable {
    ElementMatcher<MethodDescription> matcher = RoutingHandlerInstrumentation.getRoutingHandlerMethodMatcher();
    Method method1 = RoutingHandler.class.getMethod("add", HttpString.class, String.class, HttpHandler.class);
    Method method2 = RoutingHandler.class.getMethod("add", HttpString.class, String.class, Predicate.class, HttpHandler.class);
    Assert.assertTrue(matcher.matches(new MethodDescription.ForLoadedMethod(method1)));
    Assert.assertTrue(matcher.matches(new MethodDescription.ForLoadedMethod(method2)));
}
 
Example 21
Source Project: skywalking   Source File: RoutingHandlerInterceptorTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testBindArguments() throws Throwable {
    Method method = RoutingHandler.class.getMethod("add", HttpString.class, String.class, HttpHandler.class);
    Object[] arguments = new Object[] {
        Methods.GET,
        template,
        httpHandler
    };
    interceptor.beforeMethod(enhancedInstance, method, arguments, method.getParameterTypes(), methodInterceptResult);
    interceptor.afterMethod(enhancedInstance, method, arguments, method.getParameterTypes(), null);
    assertTrue(arguments[2] instanceof TracingHandler);
}
 
Example 22
Source Project: skywalking   Source File: RootHandlerInterceptorTest.java    License: Apache License 2.0 5 votes vote down vote up
@Test
public void testBindRoutingHandler() throws Throwable {
    RoutingHandler handler = new RoutingHandler();
    handler.add(Methods.GET, "/projects/{projectId}", httpHandler);
    Object[] arguments = new Object[] {handler};
    Class[] argumentType = new Class[] {HttpHandler.class};
    final Method method = Undertow.Builder.class.getMethod("setHandler", argumentType);
    rootHandlerInterceptor.beforeMethod(enhancedInstance, method, arguments, argumentType, methodInterceptResult);
    rootHandlerInterceptor.afterMethod(enhancedInstance, method, arguments, argumentType, null);
    assertTrue(arguments[0] instanceof RoutingHandler);
}
 
Example 23
Source Project: skywalking   Source File: Application.java    License: Apache License 2.0 5 votes vote down vote up
private static void undertowRouting() {
    HttpHandler httpHandler = exchange -> {
        if (ROUTING_CASE_URL.equals(exchange.getRequestPath())) {
            exchange.dispatch(httpServerExchange -> visit("http://localhost:8080/undertow-scenario/case/undertow1?send=runnable"));
        }
        exchange.getResponseHeaders().put(Headers.CONTENT_TYPE, "text/plain");
        exchange.getResponseSender().send("Success");
    };
    RoutingHandler handler = new RoutingHandler();
    handler.add(Methods.GET, TEMPLATE, httpHandler);
    handler.add(Methods.HEAD, TEMPLATE, httpHandler);
    Undertow server = Undertow.builder().addHttpListener(8081, "0.0.0.0").setHandler(handler).build();
    Runtime.getRuntime().addShutdownHook(new Thread(server::stop));
    server.start();
}
 
Example 24
Source Project: quarkus-http   Source File: Handlers.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * @return a new routing handler
 */
public static RoutingHandler routing() {
    return new RoutingHandler();
}
 
Example 25
Source Project: SikuliX1   Source File: SikulixServer.java    License: MIT License 4 votes vote down vote up
protected RoutingHandler getRouting() {
  return routing;
}
 
Example 26
Source Project: proteus   Source File: ProteusApplication.java    License: Apache License 2.0 4 votes vote down vote up
/**
 * @return the router
 */
public RoutingHandler getRouter()
{
    return router;
}
 
Example 27
Source Project: light-rest-4j   Source File: SpecDisplayHandlerTest.java    License: Apache License 2.0 4 votes vote down vote up
static RoutingHandler getTestHandler() {
    return Handlers.routing().add(Methods.GET, "/spec.yml", new SpecDisplayHandler());
}
 
Example 28
Source Project: StubbornJava   Source File: MicroMonolith.java    License: MIT License 4 votes vote down vote up
public static void main(String[] args) {

        // {{start:restServer}}
        Undertow.builder()
                .addHttpListener(8080, "0.0.0.0", Middleware.common(RestServer.ROOT))
                .build()
                .start();
        // {{end:restServer}}

        // {{start:contentTypesServer}}
        Undertow.builder()
                .addHttpListener(8081, "0.0.0.0", Middleware.common(ContentTypesServer.ROUTES))
                .build()
                .start();
        // {{end:contentTypesServer}}

        // {{start:combinedServer}}
        RoutingHandler combinedHanlder = new RoutingHandler().addAll(RestServer.ROUTES)
                                                             .addAll(ContentTypesServer.ROUTES);
        Undertow.builder()
                .addHttpListener(8082, "0.0.0.0", Middleware.common(combinedHanlder))
                .build()
                .start();
        // {{end:combinedServer}}

        // {{start:multiPortServer}}
        Undertow.builder()
                .addHttpListener(8083, "0.0.0.0", Middleware.common(RestServer.ROOT))
                .addHttpListener(8084, "0.0.0.0", Middleware.common(ContentTypesServer.ROUTES))
                .build()
                .start();
        // {{end:multiPortServer}}

        // {{start:microserviceService}}
        Undertow.builder()
                .addHttpListener(8085, "0.0.0.0", exchange -> {
            Integer port = Exchange.queryParams()
                                   .queryParamAsInteger(exchange, "port")
                                   .orElse(null);
            if (port != null) {
                try {
                    HttpHandler handler = new ConstantStringHandler("web server with port " + port);
                    Undertow.builder()
                            .addHttpListener(port, "0.0.0.0", handler)
                            .build()
                            .start();
                } catch (Exception e) {
                    String message = "error trying to create web sertver with port " + port;
                    Exchange.body().sendText(exchange, message);
                    return;
                }
                Exchange.body().sendText(exchange, "server with port " + port + " created");
                return;
            }
            Exchange.body().sendText(exchange, "port cannot be null");
        })
        .build()
        .start();
        // {{end:microserviceService}}
    }
 
Example 29
Source Project: light-4j   Source File: ServerInfoGetHandlerTest.java    License: Apache License 2.0 4 votes vote down vote up
static RoutingHandler getTestHandler() {
    return Handlers.routing().add(Methods.GET, "/server/info", new ServerInfoGetHandler());
}
 
Example 30
Source Project: light-4j   Source File: ServerInfoDisabledTest.java    License: Apache License 2.0 4 votes vote down vote up
static RoutingHandler getTestHandler() {
    return Handlers.routing().add(Methods.GET, "/v1/server/info", new ServerInfoGetHandler());
}