It will serve files from the app directories specified by appDirs.
If a file is requested that is not in one of those directories, the
files in Shinylight's own inst/www directory will be served.
Some paths have special meanings: /
returns
/index.html
, /lang/
is redirected to
/locales/<language-code>/
depending
on the language selected in the request's Accept-Language
header (that is, the browser's language setting) and the
availability of the file requested. A POST request to /init
with a data
parameter will return /index.html
, except
that if the file has a line containing shinylight_initial_data =
then this line with be replaced with a line initializing
shinylight_initial_data
to the data passed. This is used in
shinylight-framework
to permit linking to a framework app
with specific data preloaded -- the text should be as is downloaded
with the "Save Data" button. Of course, this is available to
non-framework apps, too.
rrpcServer(
interface,
host = "0.0.0.0",
port = NULL,
appDirs = NULL,
root = "/",
initialize = NULL,
testFunction = NULL
)
The server object, can be passed to slStop
List of functions to be served. The names of the elements are the names that the client will use to call them.
Interface to listen on (default is '0.0.0.0'
, that
is, all interfaces)
Port to listen on
List of directories in which to find static files to serve
Root of the app on the server (with trailing slash)
A json string or list (that will be converted to a
JSON string) to be passed to the JavaScript as initial data. For
non-framework apps, the index.html must contain a line containing
var shinylight_initial_data=
, which will be replaced with
code that sets shinylight_initial_data
to this supplied JSON
string.
Function to be called if the /test
endpoint is requested. If the function returns successfully, a 200
status will be returned. If not, a 500 status will be returned.