Kauri Documentation
 PreviousHomeNext 
6.9 URI template syntaxBook Index6.10.2 Setting generic properties on routing components

6.10 Routing reference

6.10.1 Basic syntax rules

As mentioned elsewhere, the routing configuration syntax is essentially a program written in the Groovy language.

However, don't let that scare you away with the thought of having to learn yet another language, since you get can a long way without knowing Groovy.

You can pick up the syntax by looking at some examples, such as this:

builder.router {

   restlet(uri: "/helloworld1", ofClass: "org.mycomp.HelloWorld1")

   restlet(uri: "/hello/world2", ofClass: org.mycomp.HelloWorld2")

   router(uri: "/hello") {
     restlet(uri: "/world3", ofClass: org.mycomp.HelloWorld3")
   }
}

In case you're wondering, this example will react on URIs starting with:

/helloworld1
/hello/world2
/hello/world3

From this example you can see the basic rules:

 PreviousHomeNext 
6.9 URI template syntax6.10.2 Setting generic properties on routing components