Examples of Middleware


Examples of com.jetdrone.vertx.yoke.Middleware

    @Test
    public void testRouterWithRegExParamsPass() {
        Yoke yoke = new Yoke(this);
        yoke.use(new com.jetdrone.vertx.yoke.middleware.Router() {{
            get("/api/:userId", new Middleware() {
                @Override
                public void handle(@NotNull YokeRequest request, @NotNull Handler<Object> next) {
                    request.response().end("OK");
                }
            });
View Full Code Here

Examples of com.jetdrone.vertx.yoke.Middleware

    @Test
    public void testTrailingSlashes() {
        final Yoke yoke = new Yoke(this);
        yoke.use(new com.jetdrone.vertx.yoke.middleware.Router() {{
            get("/api", new Middleware() {
                @Override
                public void handle(@NotNull YokeRequest request, @NotNull Handler<Object> next) {
                    request.response().end("OK");
                }
            });
View Full Code Here

Examples of com.jetdrone.vertx.yoke.Middleware

    @Test
    public void testDash() {
        final Yoke yoke = new Yoke(this);
        yoke.use(new com.jetdrone.vertx.yoke.middleware.Router() {{
            get("/api-stable", new Middleware() {
                @Override
                public void handle(@NotNull final YokeRequest request, @NotNull final Handler<Object> next) {
                    request.response().end("OK");
                }
            });
View Full Code Here

Examples of com.jetdrone.vertx.yoke.Middleware

        init(yoke, mount, headBindings);
        init(yoke, mount, traceBindings);
        init(yoke, mount, connectBindings);

        for (String key : paramProcessors.keySet()) {
            final Middleware m = paramProcessors.get(key);
            if (m instanceof AbstractMiddleware && !((AbstractMiddleware) m).isInitialized()) {
                ((AbstractMiddleware) paramProcessors.get(key)).init(yoke, mount);
            }
        }
View Full Code Here

Examples of com.jetdrone.vertx.yoke.Middleware

     * Specify a middleware that will be called for a matching HTTP GET
     * @param pattern The simple pattern
     * @param handler The middleware to call
     */
    public Router get(@NotNull final String pattern, @NotNull final Handler<YokeRequest> handler) {
        return get(pattern, new Middleware() {
            @Override
            public void handle(@NotNull YokeRequest request, @NotNull Handler<Object> next) {
                handler.handle(request);
            }
        });
View Full Code Here

Examples of com.jetdrone.vertx.yoke.Middleware

     * Specify a middleware that will be called for a matching HTTP PUT
     * @param pattern The simple pattern
     * @param handler The middleware to call
     */
    public Router put(@NotNull final String pattern, @NotNull final Handler<YokeRequest> handler) {
        return put(pattern, new Middleware() {
            @Override
            public void handle(@NotNull YokeRequest request, @NotNull Handler<Object> next) {
                handler.handle(request);
            }
        });
View Full Code Here

Examples of com.jetdrone.vertx.yoke.Middleware

     * Specify a middleware that will be called for a matching HTTP POST
     * @param pattern The simple pattern
     * @param handler The middleware to call
     */
    public Router post(@NotNull final String pattern, @NotNull final Handler<YokeRequest> handler) {
        return post(pattern, new Middleware() {
            @Override
            public void handle(@NotNull YokeRequest request, @NotNull Handler<Object> next) {
                handler.handle(request);
            }
        });
View Full Code Here

Examples of com.jetdrone.vertx.yoke.Middleware

     * Specify a middleware that will be called for a matching HTTP DELETE
     * @param pattern The simple pattern
     * @param handler The middleware to call
     */
    public Router delete(@NotNull final String pattern, @NotNull final Handler<YokeRequest> handler) {
        return delete(pattern, new Middleware() {
            @Override
            public void handle(@NotNull YokeRequest request, @NotNull Handler<Object> next) {
                handler.handle(request);
            }
        });
View Full Code Here

Examples of com.jetdrone.vertx.yoke.Middleware

     * Specify a middleware that will be called for a matching HTTP OPTIONS
     * @param pattern The simple pattern
     * @param handler The middleware to call
     */
    public Router options(@NotNull final String pattern, @NotNull final Handler<YokeRequest> handler) {
        return options(pattern, new Middleware() {
            @Override
            public void handle(@NotNull YokeRequest request, @NotNull Handler<Object> next) {
                handler.handle(request);
            }
        });
View Full Code Here

Examples of com.jetdrone.vertx.yoke.Middleware

     * Specify a middleware that will be called for a matching HTTP HEAD
     * @param pattern The simple pattern
     * @param handler The middleware to call
     */
    public Router head(@NotNull final String pattern, @NotNull final Handler<YokeRequest> handler) {
        return head(pattern, new Middleware() {
            @Override
            public void handle(@NotNull YokeRequest request, @NotNull Handler<Object> next) {
                handler.handle(request);
            }
        });
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.