route | R Documentation |
This function constructs a new Route, optionally with a set of handlers already attached.
route(..., root = "")
... |
Handlers to add up front. Must be in the form of named lists where the names corresponds to paths and the elements are the handlers. The name of the argument itself defines the method to listen on (see examples) |
root |
The root of the route. Will be removed from the path of any request before matching a handler |
A Route object
# An empty route
route <- route()
route
# Prepopulating it at construction
route <- route(all = list(
'/*' = function(request, response, keys, ...) {
message('Request received')
TRUE
}
))
route
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.