Skip to main content

initialize_server_state

Function initialize_server_state 

Source
pub async fn initialize_server_state() -> Result<ServerState, ServerError>
Expand description

Constructs the shared ServerState.

  • Loads DATABASE_URL from environment
  • Creates and migrates the PostgreSQL pool
  • Sets up the CQRS framework with GameQuery read model
  • Starts the database change broadcaster

Panics if the database URL is missing or migrations fail.