1.按照官方示例中的函數(shù)式編程風格,有一段如下代碼:
public HttpServer getHttpServer(){
HttpHandler httpHandler = RouterFunctions.toHttpHandler(router3);
ReactorHttpHandlerAdapter adapter = new ReactorHttpHandlerAdapter(httpHandler);
HttpServer server = HttpServer.create("localhost", 9000);
server.newHandler(adapter);
return server;
}
在測試的過程中發(fā)現(xiàn) 沒有這段代碼也可運行:文檔原話:This starter also supports the functional web API and will detect automatically RouterFunction beans.