startRookAnalysisPageServer {AnalysisPageServer} | R Documentation |
Start a new Rook AnalysisPage server. This is a convenience
wrapper around new.rook.analysis.page.app
which builds the Rook App and then also makes a Rook server (Rhttpd
object)
which just contains the one App. It then starts the server in a fork and returns the PID
of the child process.
startRookAnalysisPageServer(reg, tmpdir = tempdir(), ..., app = new.rook.analysis.page.app(reg, tmpdir = tmpdir, app.name = app.name, ...), app.name = "RAPS", port = 5000)
reg |
AnalysisPageRegistry from which to build application. Passed through to |
tmpdir |
Directory for temporary files. Passed through to |
... |
Passed through to |
app |
Rook App to put into the server. Default: |
app.name |
Name for App within server, default "RAPS" (for Rook AnalysisPageServer). This will determine the second part of the URL, for example "/custom/RAPS". |
port |
Port on which to start listening. |
list with two componenets:
$url
URL to base of application
$pid
Process ID of server
This function used to be called start.rook.analysis.page.server
but that
led to an R CMD check warning about S3 method inconsistency.
Brad Friedman
new.rook.analysis.page.app
, kill.process
## Not run: registry <- AnalysisPageServer:::trig.registry() server <- startRookAnalysisPageServer(registry, port = 5102) ## do some stuff ## For example landing.page.url <- rook.analysis.page.server.landing.page(server) ## now go to your web browser and open landing.page.url ## Or maybe something in this R process. See what the pages are pages.url <- file.path(server$url, "R", "pages") pages <- fromJSON(readLines(pages.url, warn = FALSE)) sapply(pages, "[[", "name") ## Kill the server kill.process(server) ## End(Not run) message("See vignette ExamplesServers.html")