Skip to content

Commit cc9e06d

Browse files
authored
Inspect environment variables for host & port (#167)
1 parent e4cedb3 commit cc9e06d

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

R/dash.R

+6-6
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,12 @@
114114
#' present a warning and return `NULL` if the Dash app was not loaded via `source()`
115115
#' if the `DASH_APP_PATH` environment variable is undefined.
116116
#' }
117-
#' \item{`run_server(host = Sys.getenv('DASH_HOST', "127.0.0.1"),
118-
#' port = Sys.getenv('DASH_PORT', 8050), block = TRUE, showcase = FALSE, ...)`}{
117+
#' \item{`run_server(host = Sys.getenv('HOST', "127.0.0.1"),
118+
#' port = Sys.getenv('PORT', 8050), block = TRUE, showcase = FALSE, ...)`}{
119119
#' The `run_server` method has 13 formal arguments, several of which are optional:
120120
#' \describe{
121-
#' \item{host}{Character. A string specifying a valid IPv4 address for the Fiery server, or `0.0.0.0` to listen on all addresses. Default is `127.0.0.1` Environment variable: `DASH_HOST`.}
122-
#' \item{port}{Integer. Specifies the port number on which the server should listen (default is `8050`). Environment variable: `DASH_PORT`.}
121+
#' \item{host}{Character. A string specifying a valid IPv4 address for the Fiery server, or `0.0.0.0` to listen on all addresses. Default is `127.0.0.1` Environment variable: `HOST`.}
122+
#' \item{port}{Integer. Specifies the port number on which the server should listen (default is `8050`). Environment variable: `PORT`.}
123123
#' \item{block}{Logical. Start the server while blocking console input? Default is `TRUE`.}
124124
#' \item{showcase}{Logical. Load the Dash application into the default web browser when server starts? Default is `FALSE`.}
125125
#' \item{use_viewer}{Logical. Load the Dash application into RStudio's viewer pane? Requires that `host` is either `127.0.0.1` or `localhost`, and that Dash application is started within RStudio; if `use_viewer = TRUE` and these conditions are not satsified, the user is warned and the app opens in the default browser instead. Default is `FALSE`.}
@@ -766,8 +766,8 @@ Dash <- R6::R6Class(
766766
# ------------------------------------------------------------------------
767767
# convenient fiery wrappers
768768
# ------------------------------------------------------------------------
769-
run_server = function(host = Sys.getenv('DASH_HOST', "127.0.0.1"),
770-
port = Sys.getenv('DASH_PORT', 8050),
769+
run_server = function(host = Sys.getenv('HOST', "127.0.0.1"),
770+
port = Sys.getenv('PORT', 8050),
771771
block = TRUE,
772772
showcase = FALSE,
773773
use_viewer = FALSE,

man/Dash.Rd

+3-3
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)