-
-
Notifications
You must be signed in to change notification settings - Fork 31
Closed
Labels
Description
Currently, DashR provides two separate methods for launching the fiery server and serving up a Dash app. The first is run_server():
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():
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.