gpt4 book ai didi

com.jetdrone.vertx.yoke.Yoke.use()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-14 18:48:49 30 4
gpt4 key购买 nike

本文整理了Java中com.jetdrone.vertx.yoke.Yoke.use()方法的一些代码示例,展示了Yoke.use()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Yoke.use()方法的具体详情如下:
包路径:com.jetdrone.vertx.yoke.Yoke
类名称:Yoke
方法名:use

Yoke.use介绍

[英]Adds a Handler to a route.

yoke.use("/login", new Handler<YokeRequest>() { 
public void handle(YokeRequest request) { 
request.response.end("Hello"); 
} 
});

[中]将处理程序添加到路由

yoke.use("/login", new Handler<YokeRequest>() { 
public void handle(YokeRequest request) { 
request.response.end("Hello"); 
} 
});

代码示例

代码示例来源:origin: pmlopes/yoke

/**
 * Adds a middleware to the chain with the prefix "/".
 *
 * @param middleware The middleware add to the chain
 */
public Yoke use(@NotNull IMiddleware... middleware) {
  return use("/", middleware);
}

代码示例来源:origin: pmlopes/yoke

/**
 * Adds a Handler to a route.
 *
 * <pre>
 * yoke.use("/login", new Handler&lt;YokeRequest&gt;() {
 *   public void handle(YokeRequest request) {
 *     request.response.end("Hello");
 *   }
 * });
 * </pre>
 * @param handler The Handler to add
 */
public Yoke use(@NotNull Handler<YokeRequest> handler) {
  return use("/", handler);
}

代码示例来源:origin: pmlopes/yoke

.use(new BodyParser())
.use("/middleware", foo)
.use("/middleware", foo)
.use("/middleware", foo)
.use("/middleware", foo)
.use(new Router()
  .get("/", new Handler<YokeRequest>() {
   @Override

代码示例来源:origin: pmlopes/yoke

final Yoke yoke = new Yoke(this);
yoke.use(new BodyParser());
yoke.use(new ErrorHandler(true));
yoke.use(new JsonRestRouter(db)
  .rest("/states", "states")
);
yoke.use(new Static("static"));
yoke.use(new Handler<YokeRequest>() {
 @Override
 public void handle(YokeRequest request) {

代码示例来源:origin: pmlopes/yoke

@Override
 public void start() {

  new Yoke(this)
    .use(new Router()
      .get("/", new Handler<YokeRequest>() {
       @Override
       public void handle(YokeRequest request) {
        request.response().end("Hello World\n");
       }
      })
    ).listen(8080);
 }
}

代码示例来源:origin: pmlopes/yoke

app.use(new BodyParser());
app.use(new CookieParser(hmac));
app.use(new Session(hmac));
app.use(formAuth);
app.use(new Router() {{
 get("/", new Handler<YokeRequest>() {
  @Override

代码示例来源:origin: pmlopes/yoke

yoke.use("/eventbus", new SockJS(vertx, new SockJSHandlerOptions()).bridge(options, event -> {
yoke.use(new BodyParser());
yoke.use(new ErrorHandler(true));
yoke.use(new Static("static"));

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com