spring-fu
spring-fu copied to clipboard
enable function is protected
when i use it in springboot proj , and use sample case:
public static JafuApplication app = webApplication(a -> a.beans(b -> b
.enable(webMvc(s -> s
.port(s.profiles().contains("test") ? 8181 : 8080)
.router(router -> {
}).converters(c -> c
.string()
.jackson()))));
i get that result , i can't compile that , and i want to call s.initialize() but i can't get bean context any more

after reading the code , i modified code to this and it works
public static JafuApplication app = Jafu.webApplication(ioc ->
ioc
.beans(beanDefinition ->
beanDefinition.bean(SampleHandler.class)
.bean(SampleService.class)
.bean(Sample.class))
.logging(loggingDsl -> loggingDsl.level(LogLevel.DEBUG))
.enable(WebMvcServerDsl.webMvc(dsl ->
dsl.port(dsl.profiles().contains("test") ? 8181 : 8080)
.router(router -> {
SampleHandler handler = dsl.ref(SampleHandler.class);
router.GET("/sayHello", handler::hello);
})
.converters(c ->
c.string().jackson()
)
))
);
I strongly recommend that change the demo code on readme to this