Trying to keep up with the tide.
Helpers and middleware collection for tide
- Logging middleware
- CORS Blanket middleware
middleware::log::RequestLogger
Simple logger that doesn't take any dependencies other than the log
crate.
use surf::middlewares;
app.middleware(middlewares::log::RequestLogger::new().timed());
middleware::cors::CorsBlanket
A blanket middleware for Cors.
use surf::middlewares;
app.middleware(middlewares::cors::CorsBlanket::new()
.origin(HeaderValue::from_str("https://surf-with-the-tide").unwrap())
.max_age(HeaderValue::from_str("600").unwrap()));