Commit graph

242 commits

Author SHA1 Message Date
Altair Bueno
fb21561616
Add WithRejection (#1262)
* new(axum-extra): Added `WithRejection` base impl

Based on @jplatte's version (https://github.com/tokio-rs/axum/issues/1116#issuecomment-1215048273), with slight changes

- Using `From<E::Rejection>` to define the trait bound on a more concise way
- Renamed variables to something more meaningfull

* revert(axum-extra): Removed `with_rejection` feat

* ref(axum-extra): Replaced `match` with `?`

* tests(axum-extra): Added test for `WithRejection`

* examples: Replaced custom `Json` extractor with `WithRejection`

* docs(axum-extra): Added doc to `WithRejection`

* fmt(cargo-check): removed whitespaces

* fmt(customize-extractor-error): missing fmt

* docs(axum-extra): doctest includes `Handler` test

Co-authored-by: David Pedersen <david.pdrsn@gmail.com>

* docs(axum-extra):` _ `-> `rejection`

Co-authored-by: David Pedersen <david.pdrsn@gmail.com>

* docs(axum-extra): fixed suggestions

* fix(axum-extra): `WithRejection` manual trait impl

* revert(customize-extractor-error): Undo example changes

refs: d878eede18 , f9200bf4b9

* example(customize-extractor-error): Added reference to `WithRejection`

* docs(axum-extra): Removed `customize-extractor-error` reference

* fmt(axum-extra): cargo fmt

* docs(axum-extra): Added `WithRejection` to CHANGELOG.md

Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
2022-08-17 07:59:25 +00:00
kkocdko
a8e80bcb97
Improve performance in low-level-rustls example (#1254) 2022-08-12 11:57:59 +00:00
David Pedersen
d9ef24c5ff
Replace async-graphql with link to async-graphql's own examples (#1234)
* Replace async-graphql with link to async-graphql's own examples

* exclude async-graphql directory

* does this fix it?

* apparently this needs to be sorted as well

* Update .github/workflows/CI.yml

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
2022-08-09 14:56:50 +00:00
Jonas Platte
f0f60681ef
Fix intra-doc links on docs.rs (#1205)
* Use version 2 of Cargo's feature resolver

* Increase minimum version of tungstenite

Tungstenite 0.17.1 has a higher MSRV, and there should be no reason to
use it over 0.17.2.

* Clean up and fix MSRV CI job

* Fix some intra-doc links not resolving correctly on docs.rs

* Bump minimum version of tower

… to avoid dependencies with a broken minimum-versions chain.
2022-07-28 19:14:31 +02:00
Péter Leéh
6ff1c2111e
Fix comment typos in stream-to-file example (#1200) 2022-07-27 11:10:00 +00:00
Lex Cao
3c0778b16d
Add an example for head request (#1189)
As #84 add get-head request, adding an example.
2022-07-26 20:19:03 +02:00
Sugih Jamin
4558671a0b
Redirect HTTP to HTTPS in tls-rustls example (#1166) 2022-07-23 10:23:40 +02:00
Kartavya Vashishtha
cf09f62a1a
Add example for multiple listen addrs (#1179) 2022-07-20 18:33:12 +00:00
azzamsa
a3eaa332e4
test: use ready() and call() to avoid using clone() (#1176) 2022-07-20 12:19:15 +00:00
Allan
928d60fbba
Fix two comment typos (#1172) 2022-07-18 17:16:38 +00:00
Jonas Platte
1812c4dfe8
Remove explicit TryFrom, TryInto imports (#1099) 2022-06-17 18:36:49 +00:00
David Pedersen
93251fa203
Bump MSRV to 1.56 and update to the 2021 edition (#1098) 2022-06-17 20:11:35 +02:00
David Pedersen
fd70f81c46
More robust asset paths in examples (#1090)
* More robust asset paths in examples

* Update examples/low-level-rustls/src/main.rs

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>

* format

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
2022-06-15 22:42:49 +02:00
Shing
cbb2e8a244
Fix missing assets in websockets example (#1089)
* fix missing assets running websockets example

* Update examples/websockets/src/main.rs

Co-authored-by: David Pedersen <david.pdrsn@gmail.com>

* remove unnecessary mut

* fix cargo fmt

Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
2022-06-15 10:04:44 +02:00
David Pedersen
968ee44631
Sort dependencies in Cargo.tomls (#1076)
* sort dependencies

* check sorted deps on CI

* this should fail

* does caching matter?

* fix sorting
2022-06-10 08:59:17 +02:00
David Pedersen
be71e7b286
Fix vulnerability in example-stream-to-file example (#1040)
* Fix vulnerability in example-stream-to-file example

* Save files to separate directory
2022-05-17 12:38:15 +02:00
Jonas Platte
591434778f
Slightly simplify CORS example (#1027) 2022-05-12 11:36:57 +02:00
David Pedersen
7774cfd1f7
Update static file server example (#1011) 2022-05-08 19:52:34 +00:00
takumi
4b384fa01c
upgrade uuid from 0.8 to 1.0 (#995) 2022-05-05 07:48:49 +02:00
David Pedersen
d1043db254
Fix driving readiness for example-rest-grpc-multiplex (#988) 2022-05-03 09:21:49 +00:00
takumi
4ff5e409e3
Add rest and grpc example (#967)
* Add rest and grpc example

* remove needless dependencies

* Apply suggestions from code review

Co-authored-by: David Pedersen <david.pdrsn@gmail.com>

* Update examples/rest-grpc-multiplex/src/main.rs

Co-authored-by: David Pedersen <david.pdrsn@gmail.com>

* Update examples/rest-grpc-multiplex/src/main.rs

Co-authored-by: David Pedersen <david.pdrsn@gmail.com>

* Update examples/rest-grpc-multiplex/src/multiplex_service.rs

Co-authored-by: David Pedersen <david.pdrsn@gmail.com>

* Update examples/rest-grpc-multiplex/Cargo.toml

Co-authored-by: David Pedersen <david.pdrsn@gmail.com>

* Update examples/rest-grpc-multiplex/src/multiplex_service.rs

Co-authored-by: David Pedersen <david.pdrsn@gmail.com>

* clean noisy code

* fix nitpicks

* missing newline

Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
2022-05-02 15:52:55 +00:00
David Pedersen
1fe4558362
Move examples to separate workspace (#978)
* Move examples to separate workspace

* update commands to run examples

* remove debug
2022-04-29 18:53:41 +02:00
David Pedersen
79f6cde3b1
Update to tower-http 0.3.0 (#965)
* Update to tower-http 0.3.0

* changelog link
2022-04-25 14:59:16 +00:00
Slava
0313c08dc9
helpful note about posting with CORS (#938) 2022-04-17 08:13:22 +00:00
zys864
a237edb7c3
Fix example-unix-domain-socket on non-unix platforms (#919)
* remove unused `axum`'s dependency:`tokio-util`

* fix `examples/todos`'s `async fn todos_index` iter_overeager_cloned

* Add docs to `/examples/async-graphql`, just like other xamples.

* remove `examples/async-graphql` unused dependencies `tracing-subscriber` and `trace`

* `examples/chat` deps `trace` and `tracing-subscriber` never be used. Add trace `debug` to `chat`

* remove `examples/print-request-response` unused dependency `axum-extra`

* remove `examples/prometheus-metrics` unused dependency `axum-extra`

* remove `examples/reverse-proxy` unused dependencies `tracing-subscriber` and `trace`

* `examples/chat` fmt fix

* fix `example-unix-domain-socket` compile error on not-unix platforms

Co-authored-by: zys864 <zys864@qq.com>
Co-authored-by: zys864 <zys864@gmail.com>
2022-04-08 11:29:52 +02:00
Simon Sellar
59007d6111
Minor fixup of websocket example logging text. (#910) 2022-04-06 10:33:34 +00:00
David Pedersen
2270cf7b3e
Add "stream to file" example (#903)
* Add "stream to file" example

* add title tag
2022-04-03 12:28:29 +02:00
David Pedersen
21552fe434
Remove bound from into_make_service_with_connect_info (#892)
Fixes #859
2022-03-31 16:49:49 +00:00
Evan Schwartz
3084dc10ca
Accept &str for Redirect (#889)
* Accept &str for Redirect

* Fix doc example

* fix more docs examples

* update changelog

* fix changelog label

Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
2022-03-31 10:03:06 +02:00
David Pedersen
437fe5b931
Make status codes for JsonRejection more precise (#868)
* Fix status codes for `JsonRejection` rejections

Fixes #865

* Apply suggestions from code review

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>

Co-authored-by: Jonas Platte <jplatte+git@posteo.de>
2022-03-18 16:53:39 +01:00
David Pedersen
33ee55e52c
Add example for consuming request body in middleware and extractor (#861) 2022-03-18 15:41:38 +00:00
Jonas Platte
79b94b9bd6
Replace set_var usage in examples (#829)
* examples: Fix inconsistent toml formatting

* examples: Replace set_var usage
2022-03-06 12:37:00 +01:00
Max Bruckner
99fbd3d32c
Add note about order of extractors in the reverse-proxy example (#821) 2022-03-03 22:33:33 +01:00
zys864
768d8a8218
Fix minor issues in some examples (#806)
* remove unused `axum`'s dependency:`tokio-util`

* fix `examples/todos`'s `async fn todos_index` iter_overeager_cloned

* Add docs to `/examples/async-graphql`, just like other xamples.

* remove `examples/async-graphql` unused dependencies `tracing-subscriber` and `trace`

* `examples/chat` deps `trace` and `tracing-subscriber` never be used. Add trace `debug` to `chat`

* remove `examples/print-request-response` unused dependency `axum-extra`

* remove `examples/prometheus-metrics` unused dependency `axum-extra`

* remove `examples/reverse-proxy` unused dependencies `tracing-subscriber` and `trace`

* `examples/chat` fmt fix
2022-03-01 09:30:09 +00:00
David Pedersen
a2b568c7c1
Implement tower::Layer for Extension (#801)
* Implement `tower::Layer` for `Extension`

* changelog
2022-03-01 00:39:22 +01:00
David Pedersen
f12ab072c5
Add IntoResponseParts (#797)
* Add `IntoResponseParts`

* docs

* Add test

* don't allow overriding body or response

* macroify impls

* re-order things a bit

* Fix tests

* Also allow overriding version

* Move things into separate modules

* docs

* clean up

* fix trybuild test

* remove churn

* simplify buliding response

* fixup test

* fix docs typo

* Use `HeaderValue::from_static`, might be faster

* Bring back `impl IntoResponse` in example

* Remove blanket impl to improve error message

* don't need to set `content-type`

* Apply suggestions from code review

Co-authored-by: Jonas Platte <jplatte@users.noreply.github.com>

* changelog

Co-authored-by: Jonas Platte <jplatte@users.noreply.github.com>
2022-02-28 23:04:33 +00:00
zys864
cb168b96fe
fix examples/todos's async fn todos_index iter_overeager_cloned (#794)
* remove unused `axum`'s dependency:`tokio-util`

* fix `examples/todos`'s `async fn todos_index` iter_overeager_cloned
2022-02-25 15:29:23 +01:00
frobiac
8c0926ee5b
examples(jwt): Claims.exp represents a UTC timestamp (#760)
For the example to work, it should be an epoch value in the future.

See d8a33def00/README.md (L61)
2022-02-15 21:43:31 +00:00
David Pedersen
409a6651f5
Update dependencies (#753) 2022-02-12 17:16:14 +00:00
Evgenii
0c16ce7649
fix: typo in a comment in a sqlx-postgres example (#744) 2022-02-04 08:14:34 +01:00
David Pedersen
a04fc42d75
Rework middleware docs (#732)
* rework middleware docs

* Apply suggestions from code review

Co-authored-by: Jonas Platte <jplatte@users.noreply.github.com>

Co-authored-by: Jonas Platte <jplatte@users.noreply.github.com>
2022-01-30 20:09:18 +01:00
YuKun Liu
c0473f2b6f
Expand WebSocket example to match on Message (#723) 2022-01-25 15:31:33 +00:00
FlakM
32c9ab3c56
Add sqlx example with migrations (#722)
* Add sqlx example with migrations

Simple use case for sqlx based on tokio postgres example.
Sqlite database is created on execution in ./target directory
and migrations are then run against it.

* sqlx example uses postgres instead of sqlite3

Also removed migrations and database creation code.
2022-01-25 16:20:00 +01:00
David Pedersen
9004a14302
Move middleware::from_fn into axum (#719)
* Move `middleware::from_fn` into axum

* changelog

* fix feature

* Rephrase changelog a bit
2022-01-25 10:19:06 +01:00
David Pedersen
184ea656c0 Change HeaderMap extractor to clone the headers (#698)
* Change `HeaderMap` extractor to clone the headers

* fix docs

* changelog

* inline variable

* also add changelog item to axum

* don't list types from axum in axum-core's changelog

* document that `HeaderMap::from_request` clones the headers

* fix typo

* a few more typos
2022-01-23 18:01:52 +01:00
Nick Ashley
9b4232b786 Replace public use of mime crate with &str (#642)
Replaces `Field::content_type`'s return type with `&str`.
This is a breaking change.

Closes #637
2022-01-23 18:01:52 +01:00
Nick Ashley
007a0e85f2
Use 308 instead of 301 for trailing slash redirects (#682)
* Use 308 status instead of 301 when redirecting

For redirects resulting from requests to paths with a trailing slash,
use 308 instead of 301 to prevent non-GET requests (POST, PUT, etc) from
being changed to GET.

For example, (assuming a route for /path is defined)...
  - Old behavior results in:
  POST /path/ -> GET /path

  - New behavior results in:
  POST /path/ -> POST /path

Fixes #681

* Add deprecation notice to found()

Deprecates found() due to its use of HTTP 302

* rustfmt

* Use dedicated redirect method

Use Redirect::permanent instead of re-implementing its functionality

* Remove deprecated method from example

Replace usages of Redirect:found with Redirect::to and Redirect::temporary as appropriate

* Fix panic in oauth example

Previously the example would panic if a request was made without the
`Cookie` header. Now the user is redirected to the login page as
expected.

* Update CHANGELOG

* Revert pub TypedheaderRejection fields

* Fix clippy lint

* cargo fmt

* Fix CHANGELOG link

* Adhere to implicit line length limit
2022-01-12 15:14:06 +01:00
David Pedersen
6d24a8695f
Add SSE tests (#652)
* Add SSE tests

* Simplify keep alive test a bit

* More robust keep-alive tests

* rename a bit
2022-01-03 18:48:50 +01:00
Jonas Platte
616a43aaa3
Simplify graceful shutdown (#673) 2021-12-28 16:23:07 +01:00
David Pedersen
5698fb8be9
Add metrics example (#671) 2021-12-28 15:58:48 +01:00
Jonas Platte
0a399ed0fa
A few small refactorings (#655)
* Simplify json content-type check

* Import HeaderMap from http instead of from headers

The headers crate is an optional dependency and its HeaderMap re-export
is `#[doc(hidden)]`.

* Use headers re-export in axum in examples
2021-12-27 14:02:38 +01:00
David Pedersen
f4716084a7
Add middleware::from_fn for creating middleware from async fns (#656)
* Add `middleware::from_fn` for creating middleware from async fns

* More trait impls for `Next`

* Make `Next::run` consume `self`

* Use `.router_layer` in example, since middleware returns early

* Actually `Next` probably shouldn't impl `Clone` and `Service`

Has implications for backpressure and stuff

* Simplify `print-request-response` example

* Address review feedback

* add changelog link
2021-12-27 14:01:26 +01:00
ttys3
3841ef44d5
Fix session cookie example (#638)
* refactor: refine session cookie example

* refactor: refine session_cookie extraction

* refactor: avoid to_owned()

* chore: refine debug log

Co-authored-by: 荒野無燈 <ttys3.rust@gmail.com>
2021-12-22 15:27:13 +01:00
David Pedersen
ba42783df2
Example for defining routes and handlers close together (#621) 2021-12-12 23:54:18 +01:00
David Pedersen
ecf3359980
Fix misc warnings from CI (#620) 2021-12-12 17:21:29 +01:00
Kai Jewson
9ed18d92cf
Use AtomicU32 in RouteId (#616) 2021-12-12 14:19:30 +00:00
Kai Jewson
dfb06e721c
Introduce Response type alias as a shorthand for Response<BoxBody> (#590)
* Introduce `Response` type alias as a shorthand

* Don't re-export `Response` at the crate root
2021-12-05 19:16:46 +01:00
David Pedersen
3ec680cce7
Provide more data in Path deserialization error (#574)
* Provide more error in `Path` deserialization error

* Rename

* Add error kind for deserializing sequences

* Rename

* Fix wrong docs

* Rename `MissingRouteParams`

* Rename error to have more consistency

* Rename internal error

* Update changelog

* One last renaming, for now

* Add tests

* Tweak changelog a bit
2021-12-02 08:51:29 +01:00
David Pedersen
66c5142d0c
Update tower-http (#581)
Updates to 0.2 which was just published.
2021-12-01 20:14:25 +00:00
David Pedersen
254d8fde17
Move FromRequest and IntoResponse into new axum-core crate (#564)
* Move `IntoResponse` to axum-core

* Move `FromRequest` to axum-core

* some clean up

* Remove hyper dependency from axum-core

* Fix docs reference

* Use default

* Update changelog

* Remove mention of default type
2021-11-30 13:46:13 +00:00
Kai Jewson
2b6dba49cb
Remove the associated Body type on IntoResponse (#571) 2021-11-28 18:52:18 +01:00
Pure White
5a5800c1ae
feat: default to charset=utf-8 for text content type (#554)
* feat: default to charset=utf-8 for text content type

* added changelog && fix comment

* fix workflow
2021-11-25 08:31:30 +00:00
David Pedersen
9a410371a6
Move axum-handle-error-extract into axum (#534)
* Move `axum-handle-error-extract` into axum

With 0.4 underway we can now nuke `axum-handle-error-extract` and move
its code directly into axum.

So this replaces the old `HandleErrorLayer` with one that supports async
functions and extractors.

* changelog

* fix CI
2021-11-17 19:09:58 +00:00
David Pedersen
a317072467
Rename box_body to body (#533)
Probably would have been easier to merge this change directly into
`main` first and the backport it to `v0.3.x` but here we are :P

Fixes #528
2021-11-17 12:59:29 +00:00
David Pedersen
2bd0310463
New method router (#521)
* Empty crate

* basic setup

* Support `HEAD`

* Add remaining methods

* Impl Debug

* Add `MethodRouter::merge`

* WIP

* Support same route with different methods in different calls

* Update changelog

* Bring back `any` and `any_service`

* Address review feedback
2021-11-16 20:49:07 +01:00
David Pedersen
20fabd87e9
Add CORS example (#512) 2021-11-13 22:18:14 +01:00
Eray Karatay
2507463706
update tls-rustls example (#494) 2021-11-10 15:07:09 +01:00
Imbolc
2ee66e812f
FromStr based empty_string_as_none implementation (#486) 2021-11-09 13:05:31 +01:00
Jonas Platte
9c77ee0295
Use nightly clippy & rustfmt for more style checks (#487) 2021-11-09 11:53:57 +00:00
EdorianDark
513c5a694d
Update tracing-subscriber to 0.3 (#472)
Fixes #469
2021-11-06 14:50:23 +00:00
Eray Karatay
394ba31385
update low-level-rustls example (#465) 2021-11-05 12:02:58 +01:00
David Pedersen
0be0ea6763 Actually run the routing tests 🤦 2021-11-04 12:48:37 +01:00
david-perez
071a1b26e6
Fix typos (#461) 2021-11-03 19:03:46 +00:00
David Pedersen
ba4d8a2357
Move axum crate into workspace subfolder (#458)
* Move axum crate into workspace subfolder

Over time I imagine we're gonna have other crates in this repo that
provide utilities or integrations for axum. This prepares for that by
moving the main axum crate into its own folder.

The README situation is a bit annoying because we want `./README.md`
for viewing the repo on github but `axum/README.md` for crates.io. For
now I've just copy/pasted it and added CI step to make sure they're
identical.

* update changelog link

* Add licenses to all examples

* is this how you install `diff`?

* or maybe this is how?

* fix readme links

* like this?

* fix cargo-deny step

* Try making root readme a symlink

* remove compare readme step

not needed since readme in repo root is now a symlink

* Revert "Add licenses to all examples"

This reverts commit ab321b7fb9.
2021-11-03 12:38:48 +01:00
arctic-alpaca
a442920ba3
Restructure community showcase (#454) 2021-11-03 09:20:01 +01:00
Jordan Gould
1c60255b9f
Add readme example project (#450)
* Add project based on the readme example

* Add readme project link to README.md

* Typo correction

* Update examples/readme-example/Cargo.toml

Use tracing-subscriber 0.2 to match other the other examples

Co-authored-by: David Pedersen <david.pdrsn@gmail.com>

* Update README.md

Use original readme phrasing for crate docs

Co-authored-by: David Pedersen <david.pdrsn@gmail.com>

* Rename readme-exmaple to readme

* Revert tracing call to debug from info

Co-authored-by: Jordan Gould <jordan@tineye.com>
Co-authored-by: David Pedersen <david.pdrsn@gmail.com>
2021-11-03 07:23:28 +00:00
David Pedersen
98907b8887
Add example showing how to handle empty vs missing query params (#443) 2021-11-02 14:42:47 +01:00
David Pedersen
a048d6443b Revert hello-world example
Was accidentally changed in another PR
2021-11-02 13:07:49 +01:00
David Pedersen
9465128f3e
Rework docs (#437)
This reworks axum's docs in an attempt to make things easier to find. Previously I wasn't a fan of those docs for the same topic were spread across the root module docs and more specific places like types and methods.

This changes it such that the root module docs only gives a high level introduction to a topic, perhaps with a small example, and then link to other places where all the details are. This means `Router` is now the single place to learn about routing, and etc for the topics like handlers and error handling.
2021-11-01 21:13:37 +00:00
Paul Butler
9145c0e396
Add notify.run to community showcase (#435) 2021-10-31 08:22:46 +01:00
David Pedersen
2d1635a6d7
Fix sse and ws examples (#429)
* Fix sse example

* Fix websockets example
2021-10-27 15:52:41 +00:00
David Pedersen
fc9bfb8a50
Add HTTP proxy example (#425) 2021-10-26 20:46:40 +02:00
David Pedersen
e949c47df6
Fix inconsistent naming of WebSocket rejections (#416) 2021-10-25 23:09:47 +00:00
David Pedersen
1634e67e99
Stores routes in a map (#408)
With https://github.com/tokio-rs/axum/pull/404 and https://github.com/tokio-rs/axum/pull/402 all routes now have the same types and thus we don't need to nest them but can instead store them all in a map. This simplifies the routing quite a bit and is faster as well.

High level changes:
- Routes are now stored in a `HashMap<RouteId, Route<B>>`.
- `Router::or` is renamed to `Router::merge` because thats what it does now. It copies all routes from one router to another. This also means overlapping routes will cause a panic which is nice win.
- `Router::merge` now only accepts `Router`s so added `Router::fallback` for adding a global 404 handler.
- The `Or` service has been removed.
- `Router::layer` now only adds layers to the routes you actually have meaning middleware runs _after_ routing. I believe that addresses https://github.com/tokio-rs/axum/issues/380 but will test that on another branch.
2021-10-25 20:49:39 +02:00
QP Hou
fb87a6a4d3
Add ROAPI to community showcase (#407) 2021-10-25 08:15:16 +02:00
David Pedersen
7692baf837
Reorganize method routers for handlers and services (#405)
* Re-organize method routing for handlers

* Re-organize method routing for services

* changelog
2021-10-24 20:05:16 +00:00
David Pedersen
0ee7379d4f
Fix compile time regression by boxing routes internally (#404)
This is a reimplementation of #401 but with the new matchit based router.

Fixes #399
2021-10-24 20:52:42 +02:00
David Pedersen
f10508db0b
Revamp error handling model (#402)
* Revamp error handling model

* changelog improvements and typo fixes

* Fix a few more Infallible bounds

* minor docs fixes
2021-10-24 17:33:03 +00:00
David Pedersen
9fcc884374
Change Connected::connect_info to return Self (#396)
I've been thinking that having an associated type probably isn't
necessary. I imagine most users are either using `SocketAddr` to the
remote connection IP, or writing their own connection struct.
2021-10-19 23:06:15 +02:00
Eray Karatay
a724af3d0a
Add reverse-proxy example (#389) 2021-10-19 22:52:19 +02:00
silvioprog
8ca5538405
Fix typo in main.rs (#381) 2021-10-12 18:20:27 +00:00
David Pedersen
ac291baaec
Fix dead code warnings (#373) 2021-10-07 16:49:57 +02:00
Eray Karatay
b7002f68d5
Update some examples (#364) 2021-10-05 07:50:27 +02:00
David Pedersen
f8154a088c
Add example showing up to customize extractor error (#356)
Lots have been asking about this so makes sense to have an example for.

Once this is merged I'll add a link to it in the docs.
2021-09-30 17:55:58 +00:00
LT
3adc8d733d
Add validator example (#352) 2021-09-28 18:12:23 +02:00
LT
0b3ee5b2ce
Add graceful shutdown example (#349) 2021-09-28 09:08:49 +00:00
Andrei Zolkin
9df57e6ff2
Migrate all examples to use std::env::var_os (#312) 2021-09-12 17:39:43 +02:00
David Pedersen
4e088b40f6
Show how to configure TraceLayer (#314)
This isn't very obvious so makes sense to include in the example
2021-09-10 17:56:00 +00:00
silvioprog
6c13b22cd4
Add JWT example (#306) (#308)
Co-authored-by: Jonas Platte <jplatte@users.noreply.github.com>
2021-09-10 17:51:20 +02:00
Andrei Zolkin
283bbfbd36
Add JWT auth example as community showcase (#309) 2021-09-08 06:15:17 +00:00