Skip to content

Commit

Permalink
add note on how to get ResponseOptions
Browse files Browse the repository at this point in the history
  • Loading branch information
sjud authored Feb 28, 2024
1 parent 6a83161 commit ef4c628
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions integrations/axum/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,13 @@ impl ResponseParts {
}

/// Allows you to override details of the HTTP response like the status code and add Headers/Cookies.
/// ResponseOptions is stored in your server's context if you've called `.leptos_routes` on your router.
/// ```rust
/// #[server]
/// pub async fn get_opts() -> Result<(),ServerFnError> {
/// let opts = expect_context::<leptos_axum::ResponseOptions>();
/// Ok(())
/// }
#[derive(Debug, Clone, Default)]
pub struct ResponseOptions(pub Arc<RwLock<ResponseParts>>);

Expand Down

0 comments on commit ef4c628

Please sign in to comment.