Skip to content

Commit

Permalink
Merge branch 'main' into httr2-webmockr
Browse files Browse the repository at this point in the history
  • Loading branch information
sckott committed Aug 6, 2024
2 parents 7171223 + fda4cbb commit d8afed7
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 16 deletions.
2 changes: 1 addition & 1 deletion R/utils.R
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

make_url <- function(...) {
proof_base <- Sys.getenv("PROOF_API_BASE_URL",
"https://proof-api.fredhutch.org")
"https://proof-api.fredhutch.org")
file.path(proof_base, ...)
}

Expand Down
15 changes: 8 additions & 7 deletions vignettes/proofr.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,24 @@ my_proof_token

(note: the above token is not a real token)

On your computer, save your API token as an environment variable named `PROOF_TOKEN`.
Alternatively, save your API token directly as an environment variable named `PROOF_TOKEN` so that it can be used by other `proofr` functions without exposing your token in your code. To do so, run the following:

If you've saved your `PROOF_TOKEN` env var, then you can use the other `proofr` functions.

Otherwise, you can pass your PROOF token to the `proofr` functions. If you pass your token to the functions, only do so by passing the call to `Sys.getenv` like `proof_status(token = Sys.getenv("MY_TOKEN"))`.

```r
Sys.setenv("PROOF_TOKEN" = proof_authenticate("username", "password"))
```

## Start a Cromwell Server
## Start a PROOF Server

Start the server
Start a PROOF server using the `proof_start()` function:


```r
proof_start()
```
Note: `proofr` assumes you only have one server running; if you've started a server using the app, you'll need to stop that server before starting one in R via `proofr`.

Get the URL, using `wait=TRUE` so that it doesn't return data until the server is fully ready to use
Get metadata about the PROOF server you have started, including the URL of the API, using `wait=TRUE` so that it doesn't return data until the server is fully ready to use.


```r
Expand Down
16 changes: 8 additions & 8 deletions vignettes/proofr.Rmd.og
Original file line number Diff line number Diff line change
Expand Up @@ -33,22 +33,22 @@ my_proof_token

(note: the above token is not a real token)

On your computer, save your API token as an environment variable named `PROOF_TOKEN`.

If you've saved your `PROOF_TOKEN` env var, then you can use the other `proofr` functions.

Otherwise, you can pass your PROOF token to the `proofr` functions. If you pass your token to the functions, only do so by passing the call to `Sys.getenv` like `proof_status(token = Sys.getenv("MY_TOKEN"))`.
Alternatively, save your API token directly as an environment variable named `PROOF_TOKEN` so that it can be used by other `proofr` functions without exposing your token in your code. To do so, run the following:

```{r set-env-token}
Sys.setenv("PROOF_TOKEN" = proof_authenticate("username", "password"))
```

## Start a Cromwell Server
## Start a PROOF Server

Start the server
Start a PROOF server using the `proof_start()` function:

```{r start}
proof_start()
```
Note: `proofr` assumes you only have one server running; if you've started a server using the app, you'll need to stop that server before starting one in R via `proofr`.

Get the URL, using `wait=TRUE` so that it doesn't return data until the server is fully ready to use
Get metadata about the PROOF server you have started, including the URL of the API, using `wait=TRUE` so that it doesn't return data until the server is fully ready to use.

```{r cromwell-url}
metadata <- proof_status(wait = TRUE)
Expand Down

0 comments on commit d8afed7

Please sign in to comment.