A frond in another language
A frond does not have to be TypeScript. A process in Rust, Python or anything else joins the app if it honours three things:
- the wire —
POST /_fougere/call, JSON-RPC 2.0,method = "address.op"— see the wire format; - the card —
rpc.discoveranswers its card,x-fougere-version: 1; - the errors — a whole
FougereErrorinerror.data, itscodeone of the error codes; the integer-32000stays JSON-RPC's.
Your app then runs fougere sync against it, rebuilds its entities from the card, and checks data
locally with the same rules as for any frond.
demos/rust-frond/ is one, in Rust — one entity, three operations, no entity({...}) anywhere.
demos/rust-frond7 filesCargo.toml
[package]
name = "telemetry-frond"
version = "0.1.0"
edition = "2021"
publish = false
[dependencies]
axum = "0.8"
tokio = { version = "1", features = ["rt-multi-thread", "macros"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
uuid = { version = "1", features = ["v4"] }
chrono = { version = "0.4", default-features = false, features = ["clock", "std"] }