Skip to content

Remove run_heroku and replace with logic to inspect env vars for server deployments #73

@rpkyle

Description

@rpkyle

Currently, DashR provides two separate methods for launching the fiery server and serving up a Dash app. The first is run_server():

dashR/R/dash.R

Lines 414 to 418 in 3ff3c62

run_server = function(host = NULL, port = NULL, block = TRUE, showcase = FALSE, ...) {
if (!is.null(host)) self$server$host <- host
if (!is.null(port)) self$server$port <- as.numeric(port)
self$server$ignite(block = block, showcase = showcase, ...)
},

...and the second is run_heroku():

dashR/R/dash.R

Lines 419 to 423 in 3ff3c62

run_heroku = function(host = "0.0.0.0", port = Sys.getenv('PORT', 8080), ...) {
self$server$host <- host
self$server$port <- as.numeric(port)
self$run_server(...)
}

These differ predominantly in the way they set and handle default port and host variables. It would be preferable to condense these into a single method called run_server(), and attempt to autodetect environment set sensible defaults if the app is deployed to DDS or Heroku and no defaults values are supplied for these arguments.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions