当前位置: 首页>>代码示例>>Java>>正文


Java RoutingDsl类代码示例

本文整理汇总了Java中play.routing.RoutingDsl的典型用法代码示例。如果您正苦于以下问题:Java RoutingDsl类的具体用法?Java RoutingDsl怎么用?Java RoutingDsl使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


RoutingDsl类属于play.routing包,在下文中一共展示了RoutingDsl类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: main

import play.routing.RoutingDsl; //导入依赖的package包/类
public static void main(String[] args) {
    Router router = new RoutingDsl().
            GET("/").routeTo(() -> ok("Hello World!")).
            build();
    Server server = Server.forRouter(router, 8080);

    System.out.println("Server started on " + server.httpPort());
}
 
开发者ID:greenlaw110,项目名称:simple-webframework-benchmark,代码行数:9,代码来源:Main.java

示例2: testServer

import play.routing.RoutingDsl; //导入依赖的package包/类
private TestServer testServer(final boolean isAuthEnabled) {
    final Router router = new RoutingDsl()
            .GET(URI).routeTo(() -> ok())
            .build();
    final Application app = new GuiceApplicationBuilder()
            .configure("play.http.filters", "com.commercetools.sunrise.httpauth.basic.BasicHttpAuthenticationFilters")
            .overrides(
                    bind(HttpAuthentication.class).toInstance(httpAuthentication(isAuthEnabled)),
                    bind(play.api.routing.Router.class).toInstance(router.asScala()))
            .build();
    return Helpers.testServer(app);
}
 
开发者ID:commercetools,项目名称:commercetools-sunrise-java,代码行数:13,代码来源:HttpAuthenticationFilterTest.java

示例3: provideApplication

import play.routing.RoutingDsl; //导入依赖的package包/类
@Override
protected Application provideApplication() {
    final Router router = new RoutingDsl()
            .GET(URI).routeTo(() -> ok())
            .build();
    return new GuiceApplicationBuilder()
            .configure("play.http.filters", "com.commercetools.sunrise.httpauth.basic.BasicHttpAuthenticationFilters")
            .overrides(
                    bind(HttpAuthentication.class).toInstance(new BasicHttpAuthentication(REALM, USERNAME + ":" + PASSWORD)),
                    bind(play.api.routing.Router.class).toInstance(router.asScala()))
            .build();
}
 
开发者ID:commercetools,项目名称:commercetools-sunrise-java,代码行数:13,代码来源:BasicHttpAuthenticationFilterTest.java

示例4: MockRouterProvider

import play.routing.RoutingDsl; //导入依赖的package包/类
@Inject
public MockRouterProvider(RoutingDsl routingDsl) {
    this.routingDsl = routingDsl;
}
 
开发者ID:splendidbits,项目名称:play-pushservices,代码行数:5,代码来源:PushServicesApplicationTest.java


注:本文中的play.routing.RoutingDsl类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。