register
fun register(route: String, layoutId: String? = null, initRouteMethod: InitRouteMethod? = null, pageMethod: PageMethod)(source)
Register a route, mapping it to some target composable method that will get called when that path is requested by the browser.
Routes should be internal, rooted paths, so:
Good:
/pathGood:
/path/with/subpartsBad:
pathBad:
http://othersite.com/path
Paths can also be dynamic routes, i.e. with parts that will consume values typed into the URL and exposed as variables to the page. To accomplish this, use curly braces for that part of the path.
For example: /users/{user}/posts/{post}
In that case, if the user visited /users/123456/posts/321, then that composable method will be visited, with user = 123456 and post = 321 passed down in the PageContext.