A Router object represents the handling of routing and middleware
(such as httpGET(), httpPUT(), httpPOST(), and so on). Once a Router
object is instantiated, middleware and HTTP method routes can be added. The
top level Beakr object initializes with the creation of a
Router object.
middlewareA list of specified middleware function or functions.
listenersA list of specified listeners.
addMiddleware(middlware)A method to add middleware function(s) to middleware.
addListener(listener)A method to add listeners to listeners.
processEvent(event, ...)Processes the event heard by the Listener.
invoke(req, websocket_msg, websocket_binary)This method is used to create the request-response cycle objects of the provided middleware.
addMiddleware()Router$addMiddleware(middleware)
addListener()Router$addListener(listener)
processEvent()Router$processEvent(event, ...)
invoke()Router$invoke(req, websocket_msg = NULL, websocket_binary = NULL)
clone()The objects of this class are cloneable with this method.
Router$clone(deep = FALSE)
deepWhether to make a deep clone.