public static interface Groovy.Ratpack
Groovy.ratpack(groovy.lang.Closure)
Modifier and Type | Method and Description |
---|---|
void |
bindings(Closure<?> configurer)
Registers the closure used to configure the
BindingsSpec that will back the application. |
void |
handlers(Closure<?> configurer)
Registers the closure used to build the handler chain of the application.
|
void |
include(Path path)
Evaluates the provided path using the Ratpack DSL and applies the configuration to this server.
|
void |
include(String path)
Evaluates the path provided using the Ratpack DSL and applies the configuration to this server.
|
void |
serverConfig(Closure<?> configurer)
Registers the closure used to build the configuration of the server.
|
void bindings(@DelegatesTo(value=BindingsSpec.class,strategy=1) Closure<?> configurer)
BindingsSpec
that will back the application.configurer
- The configuration closure, delegating to BindingsSpec
void handlers(@DelegatesTo(value=GroovyChain.class,strategy=1) Closure<?> configurer)
configurer
- The configuration closure, delegating to GroovyChain
void serverConfig(@DelegatesTo(value=ServerConfigBuilder.class,strategy=1) Closure<?> configurer)
configurer
- The configuration closure, delegating to ServerConfigBuilder
void include(Path path)
The configuration supplied by the included path are applied inline with the existing parent configuration.
This allows the same semantics as specifying the configuration in a single file to be followed.
For bindings(Closure)
, the configuration is appended.
For handlers(groovy.lang.Closure<?>)
and serverConfig(Closure)
, the configuration is merged.
Settings from the parent configuration that are applied after the include
, will be applied after the child configurations.
If the path
is a relative path, then it will be resolved against the location of the parent script file that is including it.
path
- The absolute path to the external Groovy DSL to included into the server.void include(String path)
The provided string is evaluated using Paths.get(String, String...)
path
- The absolute path to the external Groovy DSL to included into the server.include(Path)