http_server_mock_js

Values

pub fn server() -> http_server_mock.ServerAdapter

Returns the JavaScript/Node.js server adapter.

Pass this to http_server_mock.new/1 to create a mock server backed by a Node.js Worker thread:

use server <- http_server_mock.with_handler(
  http_server_mock.new(http_server_mock_js.server()),
  fn(req) { ... },
)

The Worker thread only transports raw HTTP requests; the actual Stub closures run on the main thread, where they were created. See internal/server_ffi.mjs for how the two sides talk to each other, and the root README for why that split exists.

Search Document