R/Redirect.R

Redirect <- setRefClass(
    'Redirect',
    fields = c('url'),
    methods = list(
	initialize = function(url,...){
	    url <<- url
	    callSuper(...)
	},
	call = function(env){
	    req <- Rook::Request$new(env)
	    res <- Rook::Response$new()
	    res$redirect(req$to_url(url))
	    res$finish()
	}
    )
)

Try the Rook package in your browser

Any scripts or data that you put into this service are public.

Rook documentation built on Nov. 10, 2022, 6:13 p.m.