6.6 Default routing
When you create a router without specifying a custom location for the router configuration, the routing will be searched at KAURI-INF/router.groovy. If this file does not exist, a default built-in configuration will be used as fallback, which is the following:
builder.router {
directory(uri: "/resources", root: "module:/resources/")
jaxRs(uri: "") {
jaxRsResource(scanPackages: "*")
jaxRsProvider(scanPackages: "*")
jaxRsGroovyScripts(path: "groovy-jax-rs")
}
}
This default routing makes available all files in KAURI-INF/resources as /resources, and automatically scans the module jar for any Java classes with JAX-RS annotations, as well as any Groovy scripts with JAX-RS annotations in KAURI-INF/groovy-jax-rs.
Previous