Skip to content
Permalink
Browse files

Fix route import when using bean reference

  • Loading branch information...
sdeleuze committed Jul 20, 2018
1 parent 6be8b90 commit f7309ac0c11659fc3acd16081ba841a78ae398a6
@@ -28,8 +28,8 @@ fun WebFluxModule.WebFluxClientModule.coroutine() : CoroutineWebFluxClientModule
}

fun coRouter(routes: (CoroutineRouterFunctionDsl.() -> Unit)) =
CoroutineRouterFunctionDsl(routes)
CoroutineRouterFunctionDsl(routes).invoke()

fun WebFluxModule.WebFluxServerModule.coRouter(routes: (CoroutineRouterFunctionDsl.() -> Unit)) {
this.router { CoroutineRouterFunctionDsl(routes) }
}
this.include { CoroutineRouterFunctionDsl(routes).invoke() }
}
@@ -119,8 +119,8 @@ open class WebFluxModule(private val init: WebFluxModule.() -> Unit): AbstractMo
this.routes.add(RouterFunctionDsl(routes))
}

fun router(routes: RouterFunction<ServerResponse>) {
this.routes.add{ routes }
fun include(router: () -> RouterFunction<ServerResponse>) {
this.routes.add(router)
}

}
@@ -30,6 +30,7 @@ import org.springframework.fu.module.logging.logback.debug
import org.springframework.fu.module.logging.logback.consoleAppender
import org.springframework.fu.module.logging.logback.rollingFileAppender
import org.springframework.fu.module.mustache.mustache
import org.springframework.fu.module.webflux.coroutine.coRouter
import org.springframework.fu.module.webflux.netty.netty
import org.springframework.fu.module.webflux.webflux
import org.springframework.fu.ref
@@ -62,7 +63,7 @@ val app = application {
codecs {
jackson()
}
router {routes(ref()) }
include { routes(ref()) }
}
}
configuration(configuration)
@@ -31,7 +31,6 @@ import org.springframework.fu.module.mustache.mustache
import org.springframework.fu.module.webflux.netty.netty
import org.springframework.fu.module.webflux.webflux
import org.springframework.fu.ref
import org.springframework.web.reactive.function.server.router
import java.io.File

val app = application {
@@ -58,9 +57,10 @@ val app = application {
codecs {
jackson()
}
router(routes(ref()))
include { routes(ref()) }
}
}

configuration(configuration)
mongodb()
}

0 comments on commit f7309ac

Please sign in to comment.
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.