pub mod get; pub mod post; pub use get::get_handler; pub use post::normalize_mf2; pub use post::post_handler; pub struct CORSMiddleware {} use crate::database; use crate::ApplicationState; use async_trait::async_trait; use tide::{Next, Request, Result}; #[async_trait] impl tide::Middleware> for CORSMiddleware where B: database::Storage + Send + Sync + Clone, { async fn handle( &self, req: Request>, next: Next<'_, ApplicationState>, ) -> Result { let mut res = next.run(req).await; res.insert_header("Access-Control-Allow-Origin", "*"); Ok(res) } }