Actix web flash is an unofficial crate to provide flash messages in servers using Actix web.
Flash messages are typically used to display errors on websites that are rendered server side.
```rust use actixweb::{http, server, App, HttpRequest, HttpResponse, Responder}; use actixweb_flash::{FlashMessage, FlashResponse, FlashMiddleware};
fn showflash(flash: FlashMessage
fn setflash(req: &HttpRequest) -> FlashResponse
fn main() { server::new(|| { App::new() .middleware(FlashMiddleware::default()) .route("/showflash", http::Method::GET, showflash) .resource("/setflash", |r| r.f(setflash)) }).bind("127.0.0.1:8080") .unwrap() .run(); } ```
MIT/Apache-2.0