dream_mock_server/router

router.gleam - Routes for mock server

Defines both streaming and non-streaming endpoints for testing Dream’s HTTP client.

Endpoints

Non-streaming:

Streaming:

Values

pub fn create_config_router() -> router.Router(
  config.MockConfigContext,
  router.EmptyServices,
)

Create a router for config mode: a single catch-all route per method that delegates to the config controller. Used when starting with server.start_with_config(port, config).

This router intentionally contains no built-in demo endpoints. All response behavior comes from the caller-provided MockRoute list held in context.

pub fn create_router() -> router.Router(
  context.EmptyContext,
  router.EmptyServices,
)

Create a router with all mock endpoints (streaming and non-streaming)

Returns a router configured with all available mock endpoints for testing HTTP clients. Use this router when starting the server programmatically.

Search Document