diff options
author | Michael Alyn Miller <malyn@strangeGizmo.com> | 2021-11-27 20:59:51 -0800 |
---|---|---|
committer | Dirkjan Ochtman <dirkjan@ochtman.nl> | 2021-11-27 22:03:18 -0800 |
commit | 4940b5dd5e792811491f1c3c3b1c70c8177c7e02 (patch) | |
tree | 4d28ad21a66ecf9496c265c0844b4c4d036763bc /book/src/integrations.md | |
parent | 3ef2869f48556a0aae4ca861889f9fd8bea02d66 (diff) | |
download | askama-4940b5dd5e792811491f1c3c3b1c70c8177c7e02.tar.gz askama-4940b5dd5e792811491f1c3c3b1c70c8177c7e02.tar.bz2 askama-4940b5dd5e792811491f1c3c3b1c70c8177c7e02.zip |
Add Axum integration
Diffstat (limited to '')
-rw-r--r-- | book/src/integrations.md | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/book/src/integrations.md b/book/src/integrations.md index a972e4d..918b887 100644 --- a/book/src/integrations.md +++ b/book/src/integrations.md @@ -20,6 +20,18 @@ a value of that type in an Actix-web handler. See [the example](https://github.com/djc/askama/blob/main/askama_actix/tests/basic.rs) from the Askama test suite for more on how to integrate. +## Axum integration + +Enabling the `with-axum` feature appends an implementation of Axum's +`IntoResponse` trait for each template type. This makes it easy to trivially +return a value of that type in a Axum handler. See +[the example](https://github.com/djc/askama/blob/main/askama_axum/tests/basic.rs) +from the Askama test suite for more on how to integrate. + +In case of a run-time error occurring during templating, the response will be of the same +signature, with a status code of `500 Internal Server Error`, mime `*/*`, and an empty `Body`. +This preserves the response chain if any custom error handling needs to occur. + ## Gotham integration Enabling the `with-gotham` feature appends an implementation of Gotham's |