tgve_server | R Documentation |
The function accepts a 'path' to get a directory containing an instance of TGVE, by default this is done via 'TEMP_DIR_ENV' env variable. If neither is given then the function copies a clean copy of the bundled TGVE version into a temporary directory.
tgve_server( path = Sys.getenv("TEMP_path_ENV"), port = 8000, host = "127.0.0.1", background = FALSE, run = TRUE )
path |
location of TGVE path to be served by plumber. |
port |
to serve from. |
host |
host to pass to plumber default 'http://127.0.0.1' to 'FALSE'. |
background |
run the R process in the background using 'callr', defaults to 'TRUE'. |
run |
whether to start the server, defaults to 'TRUE'. If not, then the created server will be returned. |
the valude returned depends on: (1) 'run', if it is FALSE then an instance of 'plumber::pr', (2) if 'run' is true and 'background' is TRUE the 'plumber::pr' instance is started and its process is returned, and (3) if 'run' is TRUE and 'background' is FALSE then a message is displayed showing the blocking ‘plumber::pr' instance’s 'path', 'port' and 'host'.
{ # This will run in the background using `callr` ps = tgve_server(background = TRUE) Sys.sleep(2) ps$kill() }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.