use of ratpack.server.ServerConfigBuilder in project ratpack by ratpack.
the class RatpackClosureConfigurer method execute.
@Override
public void execute(RatpackServerSpec server) throws Exception {
RatpackDslClosures closures = new RatpackDslClosures(null);
RatpackDslBacking backing = new RatpackDslBacking(closures);
ClosureUtil.configureDelegateFirst(backing, closure);
server.registry(Guice.registry(ClosureUtil.delegatingAction(closures.getBindings())));
server.handlers(Groovy.chainAction(closures.getHandlers()));
ServerConfigBuilder builder = ServerConfig.builder().development(true);
if (ephemeralPort) {
builder.port(0);
}
ClosureUtil.configureDelegateFirst(builder, closures.getServerConfig());
server.serverConfig(builder);
}
Aggregations