Starts a Plumber API server for the ROMOPAPI package. If no database configuration is provided, it automatically uses the test FinnGen Eunomia database and creates necessary code counts tables.
runApiServer(
cohortTableHandlerConfig = NULL,
host = "127.0.0.1",
port = 8564,
buildCountsTable = FALSE,
...
)Configuration for connecting to the OMOP CDM database. If NULL, uses test Eunomia database
Host address to run the API server on. Defaults to "127.0.0.1"
Port number to run the API server on. Defaults to 8564
Logical indicating whether to build code counts tables. Defaults to FALSE
Additional arguments passed to plumber::pr_run()
The API server includes CORS support and automatic API documentation. When using the test database, code counts tables are automatically created.
if (FALSE) { # \dontrun{
# Run with default test database
runApiServer()
# Run with custom configuration
config <- list(...) # your database config
runApiServer(cohortTableHandlerConfig = config, port = 9000)
} # }