This project is implemented to use Cloudflare KV in non-worker environment.
worker/kv_proxy.js to create a new Cloudflare Worker using your browser, and click Save and Deploy.KEY, the value will be your access token(please make it long enough).```rust
struct Demo { name: String, age: u8, } let data = Demo { name: "red".to_string(), age: 21, };
let client = Client::new("https://your-proxy.workers.dev", "YOUR-TOKEN").unwrap();
println!("Put string: {:?}", client.put("testkey", "balabala").await);
println!("Get string: {:?}", client.get::
println!("Put struct: {:?}", client.put("testkey2", &data).await);
println!("Get struct: {:?}", client.get::
To avoid unnecessary requests to Cloudflare, the proxy caches the response.
By default the caching is enabled. You can set default-features = false in Cargo.toml.