All Downloads are FREE. Search and download functionalities are using the official Maven repository.

undertow.handler.mustache Maven / Gradle / Ivy

There is a newer version: 7.8.0
Show newest version
package org.openapitools.handler;

import com.networknt.config.Config;
import com.networknt.server.HandlerProvider;
import io.undertow.Handlers;
import io.undertow.server.HttpHandler;
import io.undertow.server.HttpServerExchange;
import io.undertow.util.Methods;

public class PathHandlerProvider implements HandlerProvider {

    public HttpHandler getHandler() {
        HttpHandler handler = Handlers.routing()

{{#apiInfo}}
{{#apis}}
{{#operations}}
{{#operation}}

            .add(Methods.{{httpMethod}}, "{{{basePathWithoutHost}}}{{{path}}}", new HttpHandler() {
                        public void handleRequest(HttpServerExchange exchange) throws Exception {
                            exchange.getResponseSender().send("{{operationId}}");
                        }
                    })

{{/operation}}
{{/operations}}
{{/apis}}
{{/apiInfo}}
        ;
        return handler;
    }
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy