美文网首页
WebFlux Q&A

WebFlux Q&A

作者: 有bear来啊 | 来源:发表于2018-04-01 16:33 被阅读0次

    1.按照官方示例中的函数式编程风格,有一段如下代码:

        public HttpServer getHttpServer(){
            HttpHandler httpHandler = RouterFunctions.toHttpHandler(router3);
            ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(httpHandler);
            HttpServer server = HttpServer.create("localhost", 9000);
            server.newHandler(adapter);
            return server;
        }
    

    在测试的过程中发现 没有这段代码也可运行:文档原话:This starter also supports the functional web API and will detect automatically RouterFunction beans.

    相关文章

      网友评论

          本文标题:WebFlux Q&A

          本文链接:https://www.haomeiwen.com/subject/occacftx.html