# Confetti 🎉 ## Fun with CloudFlare Workers ### 🐑 Use `wrangler generate` to Clone this Template [Learn more about `wrangler generate` here.](https://github.com/cloudflare/wrangler) ``` wrangler generate wasm-worker https://github.com/pinatasoftware/confetti-template.git cd wasm-worker ``` ### 🎉 Confeti helps with requests #### Routes Each route has a pattern a list of middlewares: ```rust Route { pattern: (Method::Get, "/"), middlewares: vec![fetch_session, validate_user, home], }, ``` Each middleware is run one after the other. If any middleware halts then the response is sent immediately and all remaining middlewares will not run #### Middlewares Middlewares are async functions that receive and return a Conn ```rust pub async fn hello(conn: Conn) -> Conn { let mut headers = conn.resp_headers; headers.insert("Content-Type".to_string(), "text/html".to_string()); let content = "