Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update proofr.Rmd #21

Merged
merged 4 commits into from
Aug 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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