Skip to content

quixon-labs/surf

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Surf

Trying to keep up with the tide.

Helpers and middleware collection for tide

Current features

  • Logging middleware
  • CORS Blanket middleware

Notes

  • 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()));