fetchlet-http 0.1.0

Serve fetchlet applications through Tower, hyper, axum and actix-web
Documentation
[package]
name = "fetchlet-http"
version.workspace = true
edition.workspace = true
rust-version.workspace = true
license.workspace = true
repository.workspace = true
publish = true
# package.json is the version placeholder for pnpm change (docs/releasing.md);
# vite.config.ts compiles js-src/ into the committed js/.
exclude = ["package.json", "vite.config.ts"]
description = "Serve fetchlet applications through Tower, hyper, axum and actix-web"

# The JavaScript engine is selected on the fetchlet crate. These features only
# add server integrations over the always-available Tower service.
[features]
default = []
# Run the server's instances in child processes (`Server::isolation`).
process = ["fetchlet/process"]
# Serve an artifact while a build tool rewrites it, for development.
dev-reload = ["dep:tokio"]
# Serve a Vite dev server's modules through the module runner, for development.
vite-dev = ["dep:hyper", "hyper/client", "dep:hyper-util", "dep:tokio"]
axum = ["dep:axum", "dep:tower-http", "dep:tokio", "tokio/net", "tokio/signal"]
# Accept WebSocket upgrades in the axum service and server.
axum-websocket = ["axum", "axum/ws"]
actix = ["dep:actix-web", "dep:futures-core", "dep:tokio"]
# Accept WebSocket upgrades in the actix-web service.
actix-websocket = ["actix", "dep:actix-ws", "dep:actix-http"]
hyper = ["dep:hyper"]

# Every integration, and an engine on fetchlet so that `Server` is documented.
[package.metadata.docs.rs]
features = [
  "fetchlet/quickjs",
  "process",
  "dev-reload",
  "vite-dev",
  "axum-websocket",
  "actix-websocket",
  "hyper",
]

[dependencies]
fetchlet.workspace = true
actix-web = { workspace = true, optional = true }
actix-http = { version = "3", default-features = false, features = ["ws"], optional = true }
actix-ws = { version = "0.4", optional = true }
axum = { workspace = true, optional = true }
brotli-decompressor = "6"
bytes = "1"
futures-core = { version = "0.3", optional = true }
http = "1"
http-body = "1"
http-body-util = "0.1"
hyper = { workspace = true, optional = true }
hyper-util = { version = "0.1", features = ["client-legacy", "http1", "tokio"], optional = true }
serde.workspace = true
serde_json.workspace = true
thiserror.workspace = true
tokio = { workspace = true, optional = true }
tower-http = { workspace = true, optional = true }
tower-service = "0.3"

[dev-dependencies]
# The integration contract runs on every engine.
fetchlet = { workspace = true, features = ["quickjs", "boa", "v8", "web-apis"] }
actix-http = "3"
actix-web = { workspace = true, features = ["macros"] }
anyhow.workspace = true
brotli-decompressor = "6"
futures-util = { version = "0.3", default-features = false, features = ["sink"] }
hyper = { workspace = true, features = ["client"] }
hyper-util = { version = "0.1", features = ["tokio"] }
tokio = { workspace = true, features = ["net", "io-util"] }
tokio-tungstenite = "0.30"
tower.workspace = true

[[test]]
name = "dev_reload"
required-features = ["dev-reload", "axum"]

[[test]]
name = "vite_dev"
required-features = ["vite-dev", "axum"]

[[test]]
name = "axum"
required-features = ["axum"]

[[test]]
name = "axum_router"
required-features = ["axum"]

[[test]]
name = "axum_websocket"
required-features = ["axum-websocket"]

[[test]]
name = "actix"
required-features = ["actix"]

[[test]]
name = "actix_websocket"
required-features = ["actix-websocket"]

[[test]]
name = "hyper"
required-features = ["hyper"]

[[test]]
name = "server"
required-features = ["axum"]

[[test]]
name = "webview"
required-features = ["axum"]

[[test]]
name = "artifact"
required-features = ["axum"]

# The server starts this executable as each instance's child, so it has its
# own main.
[[test]]
name = "server_isolation"
harness = false
required-features = ["axum", "process"]