Skip to content

Commit

Permalink
allow user to overwrite host parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentGuyader committed Nov 21, 2023
1 parent 20abf32 commit 0e4c6bc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions inst/marioboxexample/R/run_plumber.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,12 @@
#' Read the yaml file listing all endpoints and
#' deploy them
#'
#' @param host The IPv4 address that the plumber should listen on.
#' Defaults to the plumber.host option, if set, or "127.0.0.1" if not.
#'
#' @export
run_api <- function() {
generate_api()$run()
run_api <- function(host = getOption("plumber.host",default = "127.0.0.1")) {
generate_api()$run(host = host)
}

generate_api <- function() {
Expand Down

0 comments on commit 0e4c6bc

Please sign in to comment.