crates/knut-wasm-host/Cargo.toml
[package]
name = "knut-wasm-host"
description = "Serve a directory of wasm-bundle bytes and a stream of data frames to a browser — component-agnostic: hyper only, no web framework, no component library"
version.workspace = true
edition.workspace = true
authors.workspace = true
license.workspace = true
repository.workspace = true
[features]
default = []
# An `axum::Router` wrapper around the hyper service, for a caller that already
# runs axum (knut's own `knutpipe web`). OFF BY DEFAULT — the core must stay
# mountable on a bare hyper/tonic server (korp) without dragging a web framework
# in behind it.
axum = ["dep:axum"]
[dependencies]
# The whole HTTP surface: `hyper::http` (Request/Response/StatusCode/header),
# `hyper::body::{Body, Frame}` (the `http_body` traits, re-exported) and
# `hyper::service::Service` — the trait a caller mounts. hyper is the ONLY http
# dependency here on purpose: korp's server is hyper under tonic, so the host has
# to be takeable without a framework.
hyper = { version = "1", default-features = false }
# `Full<Bytes>` — the one-shot body every file/refusal response carries.
http-body-util = "0.1"
# Zero-copy bytes: a bundle is read once and handed to thousands of responses.
bytes = { workspace = true }
# `sync` for the frame channel behind the SSE body, `time` for its keep-alive
# comment. No runtime is started here; the caller owns that.
tokio = { version = "1", default-features = false, features = ["sync", "time"] }
# The optional `axum` wrapper. Nothing in the core touches it.
axum = { version = "0.8", optional = true }
[dev-dependencies]
# Drive the axum wrapper as a test client and collect response bodies.
tokio = { version = "1", features = ["rt", "rt-multi-thread", "macros", "sync", "time"] }
http-body-util = "0.1"
# Drive the `axum` feature's Router as a test client (`oneshot`). Dev only — the
# core must not carry a tower dependency.
tower = { version = "0.5", features = ["util"] }