I have made a DSL to run a Spring WebFlux Applicat...
# server
t
I have made a DSL to run a Spring WebFlux Application in a functional way
Copy code
fun main(args: Array<String>) {
    webfluxApplication(Server.NETTY) { // or TOMCAT
    
        // group routers
        routes {
            router { routerApi(ref()) }
            router(routerStatic())
        }
        router { routerHtml(ref(), ref()) }
    
        // group beans
        beans {
            bean<UserHandler>()
            bean<Baz>()  // Primary constructor injection
        }
        bean<Bar>()
    
        mustacheTemplate()
    
        profile("foo") {
            bean<Foo>()
        }
    }.run()
}