Skip to content

Commit

Permalink
Adds PHENOSCAPE_API environment variable
Browse files Browse the repository at this point in the history
Adds PHENOSCAPE_API environment variable that will override the
base API URL when set. The default API URL is
https://kb.phenoscape.org/api.

Running tests with the dev instance can be done like so:
```
PHENOSCAPE_API=https://stars-app.renci.org/phenoscape-dev-api Rscript -e 'devtools::test()'
```
  • Loading branch information
johnbradley committed Mar 5, 2021
1 parent 17c7e45 commit 217b373
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions R/pkb_get.R
Expand Up @@ -120,7 +120,7 @@ get_nexml_data <- function(url, query, verbose = FALSE, forceGET = FALSE) {
pkb_api <- function(...) {
path <- paste(..., sep = "/")
if (! startsWith(path, "/")) path <- paste0("/", path)
paste0("https://kb.phenoscape.org/api", path)
paste0(phenoscape_api, path)
}

#' Creates a list of named query parameters
Expand Down Expand Up @@ -210,4 +210,6 @@ ua <- local({
}
.ua
}
})
})

phenoscape_api <- Sys.getenv("PHENOSCAPE_API", "https://kb.phenoscape.org/api")

0 comments on commit 217b373

Please sign in to comment.