Installation
The cookie machinery is not included in the project scaffolded by pavex new
.
You need to go through a few steps to set it up.
CookieKit
CookieKit
bundles together all the components you need to manipulate cookies.
Register it with your Blueprint
to get started:
src/blueprint.rs
use pavex::blueprint::Blueprint;
use pavex::cookie::CookieKit;
pub fn blueprint() -> Blueprint {
let mut bp = Blueprint::new();
CookieKit::new().register(&mut bp);
// [...]
}
You can customize each component inside CookieKit
to suit your needs.
Check out the "Kits"
section for reference examples.