Package com.jetdrone.vertx.yoke

Examples of com.jetdrone.vertx.yoke.Yoke.use()


        // install custom middleware to identify the domain
        yoke.use(new DomainMiddleware(config));
        // install the static file server
        // note that since we are mounting under /static the root for the static middleware
        // will always be prefixed with /static
        yoke.use("/static", new Static("."));
        // install the BasicAuth middleware
        yoke.use("/admin", new BasicAuth(config.adminUsername, config.adminPassword));
        // install body parser for /admin requests
        yoke.use("/admin", new BodyParser());
        // install router for admin requests
View Full Code Here


        // install the static file server
        // note that since we are mounting under /static the root for the static middleware
        // will always be prefixed with /static
        yoke.use("/static", new Static("."));
        // install the BasicAuth middleware
        yoke.use("/admin", new BasicAuth(config.adminUsername, config.adminPassword));
        // install body parser for /admin requests
        yoke.use("/admin", new BodyParser());
        // install router for admin requests
        yoke.use(new Router()
            .get("/admin", new Middleware() {
View Full Code Here

        // will always be prefixed with /static
        yoke.use("/static", new Static("."));
        // install the BasicAuth middleware
        yoke.use("/admin", new BasicAuth(config.adminUsername, config.adminPassword));
        // install body parser for /admin requests
        yoke.use("/admin", new BodyParser());
        // install router for admin requests
        yoke.use(new Router()
            .get("/admin", new Middleware() {
                @Override
                public void handle(final YokeRequest request, final Handler<Object> next) {
View Full Code Here

        // install the BasicAuth middleware
        yoke.use("/admin", new BasicAuth(config.adminUsername, config.adminPassword));
        // install body parser for /admin requests
        yoke.use("/admin", new BodyParser());
        // install router for admin requests
        yoke.use(new Router()
            .get("/admin", new Middleware() {
                @Override
                public void handle(final YokeRequest request, final Handler<Object> next) {
                    final Config.Domain domain = request.get("domain");
View Full Code Here

                    });
                }
            }));

        // if the request fall through it is a view to render from the db
        yoke.use(new Middleware() {
            @Override
            public void handle(final YokeRequest request, final Handler<Object> next) {
                final Config.Domain domain = request.get("domain");
                final String file = request.path().toLowerCase();
View Full Code Here

    @Override
    public void start() {
        final Yoke yoke = new Yoke(this);
        yoke.engine("hbs", new HandlebarsEngine("views"));

        yoke.use(new BodyParser());
        yoke.use(new ErrorHandler(true));

        JsonObject persistorCfg = new JsonObject();
        persistorCfg.putString("host", "localhost");
        persistorCfg.putNumber("port", 27017);
View Full Code Here

    public void start() {
        final Yoke yoke = new Yoke(this);
        yoke.engine("hbs", new HandlebarsEngine("views"));

        yoke.use(new BodyParser());
        yoke.use(new ErrorHandler(true));

        JsonObject persistorCfg = new JsonObject();
        persistorCfg.putString("host", "localhost");
        persistorCfg.putNumber("port", 27017);
        persistorCfg.putString("address", "mongo.persons");
View Full Code Here

        final MongoDbStore db = new MongoDbStore(eb, "mongo.persons");

        JsonRestRouter router = new JsonRestRouter(db);
        router.rest("/persons", "persons");

        yoke.use(router);

        yoke.use(new Handler<YokeRequest>() {
            @Override
            public void handle(YokeRequest request) {
View Full Code Here

        JsonRestRouter router = new JsonRestRouter(db);
        router.rest("/persons", "persons");

        yoke.use(router);

        yoke.use(new Handler<YokeRequest>() {
            @Override
            public void handle(YokeRequest request) {

                List<Map> users = new ArrayList<>();
                Map<String, String> user;
View Full Code Here

    @Test
    public void testMiddleware() {
        final Yoke yoke = new Yoke(this);

        yoke.use(new AbstractMiddleware() {
            @Override
            public void handle(@NotNull YokeRequest request, @NotNull Handler<Object> next) {
                assertNotNull(this.yoke);
                testComplete();
            }
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.