Skip to contents

Setup the server-side components of the survey application by initializing logging and database operations in the parent environment. Creates a logger instance and establishes database connections with error handling.

Usage

server_setup(
  session,
  db_config,
  app_pool,
  survey_logger,
  db_ops,
  suppress_logs
)

Arguments

session

Shiny session object containing the session token.

db_config

List. Database configuration parameters:

  • log_table: Name of logging table

  • write_table: Name of survey data table

app_pool

Database connection pool object from global environment

survey_logger

Reference class object for logging functionality

db_ops

Reference class object for database operations

Details

Creates two objects in the parent environment:

  • logger: Initialized survey logger object

  • db_ops: Initialized database operations object (NULL if initialization fails)

Examples

if (FALSE) { # \dontrun{
server_setup(
  session = session,
  db_config = db_config,
  app_pool = app_pool,
  survey_logger = survey_logger,
  db_ops = db_ops
)
} # }