Creating a REST API Using URL Annotations¶
You may have noticed that the automatic URL generation is meant to be quick and easy-to-use for simple cases (creating an API in 15 minutes kind of thing).
It is more powerful though, however, as you can customize it
to get the URLs for RequestHandlers how you want without
having to make additions to output from
yourself. This is done through the use of “URL annotations”.
ViewHandler have two “magic” attributes
__url_names__) that allow you to define custom routes right in the handler
body. See relevant documentation in the
example in the demos.