how can I create a redirect rest web service in spring WebFlux? It seems that there is no redirect functionality in WebFlux yet!
I want something like this:
@Bean
RouterFunction monoRouterFunction() {
return
route(GET("/redirect/{id}"),{
req -> req.Redirect( fetchAUrlFromDataBase() )
})
解决方案@Bean
RouterFunction routerFunction() {
route(GET("/redirect"), { req ->
ServerResponse.temporaryRedirect(URI.create(TargetUrl))
.build()
}
})
}
Thanks you very much Johan Magnusson