add reactlog resource path when calling for reactlog

This commit is contained in:
Barret Schloerke
2018-06-21 15:24:17 -04:00
parent 4304e92f0d
commit 31854ad9e8
3 changed files with 13 additions and 0 deletions

View File

@@ -22,6 +22,14 @@ reactLogHandler <- function(req) {
))
} else if (identical(req$PATH_INFO, "/reactlog")){
if (!hasResourcePath("reactlogAsset")) {
addResourcePath(
"reactlogAsset",
system.file("reactlogAsset", package = "shinyreactlog")
)
}
sessionToken <- parseQueryString(req$QUERY_STRING)$s
return(httpResponse(

View File

@@ -72,6 +72,10 @@ addResourcePath <- function(prefix, directoryPath) {
)
}
hasResourcePath <- function(prefix) {
!is.null(.globals$resources[[prefix]])
}
resourcePathHandler <- function(req) {
if (!identical(req$REQUEST_METHOD, 'GET'))
return(NULL)