David Pedersen
f8a0d81d79
Remove tower from axum's public API ( #229 )
...
Instead rely on `tower-service` and `tower-layer`. `tower` itself is
only used internally.
Fixes https://github.com/tokio-rs/axum/issues/186
2021-08-21 15:01:30 +02:00
David Pedersen
ca4d9a2bb9
Replace route with Router::new().route() ( #215 )
...
This way there is now only one way to create a router:
```rust
use axum::{Router, handler::get};
let app = Router::new()
.route("/foo", get(handler))
.route("/foo", get(handler));
```
`nest` was changed in the same way:
```rust
use axum::Router;
let app = Router::new().nest("/foo", service);
```
2021-08-19 22:37:48 +02:00
David Pedersen
97b53768ba
Replace RoutingDsl trait with Router type ( #214 )
...
* Remove `RoutingDsl`
* Fix typo
2021-08-19 21:24:32 +02:00
David Pedersen
e22045d42f
Change nested routes to see the URI with prefix stripped ( #197 )
2021-08-18 09:48:36 +02:00
Florian Thelliez
d9a06ef14b
Remove axum::prelude ( #195 )
2021-08-18 00:04:15 +02:00
David Pedersen
8500ea256d
Implement FromRequest for http::Extensions ( #169 )
...
Not sure its very useful but odd to not provide this. All other request
parts have an extractor and we already have the rejection for it.
2021-08-08 20:01:06 +02:00
David Pedersen
6b218c7150
Clean up RequestParts API ( #167 )
...
In http-body 0.4.3 `BoxBody` implements `Default`. This allows us to
clean up the API of `RequestParts` quite a bit.
2021-08-08 19:48:30 +02:00
David Pedersen
b75b7b0184
Re-export more body utilities ( #162 )
...
Useful when implementing `IntoResponse`
2021-08-08 16:41:17 +02:00
David Pedersen
b4bdddf9d2
Add NestedUri ( #161 )
...
Fixes https://github.com/tokio-rs/axum/issues/159
2021-08-08 14:45:31 +02:00
David Pedersen
4bb17cbc2d
Remove take_* methods from RequestParts for Version, Method, and Uri ( #151 )
...
* Remove `RequestParts::take_method`
* Remove `RequestParts::take_uri`
* Remove `RequestParts::take_version`
2021-08-07 20:24:13 +02:00
David Pedersen
75b5615ccd
Add axum::Error ( #150 )
...
Replace `BoxStdError` and supports downcasting
2021-08-07 19:56:44 +02:00
David Pedersen
5c12328892
Replace hyper::Server with axum::Server in docs ( #118 )
...
* Replace `hyper::Server` with `axum::Server` in docs
* Change readme as well
2021-08-04 15:38:51 +02:00
David Pedersen
9a6bc4e962
Break up extract.rs ( #103 )
...
This breaks up `extract.rs` into several smaller submodules. The public
API remains the same.
This is done in prep for adding more tests to extractors which would get
messy if they were all in the same file.
2021-08-03 21:55:48 +02:00