Commit Graph
8 Commits
Author SHA1 Message Date
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
Florian Thelliez d9a06ef14b Remove axum::prelude (#195) 2021-08-18 00:04:15 +02:00
David Pedersen 75b5615ccd Add axum::Error (#150)
Replace `BoxStdError` and supports downcasting
2021-08-07 19:56:44 +02:00
David Pedersen ab927033b3 Support returning any http_body::Body from IntoResponse (#86)
Adds associated `Body` and `BodyError` types to `IntoResponse`. This is required for returning responses with bodies other than `hyper::Body` from handlers. That wasn't previously possible.

This is a breaking change so should be shipped in 0.2.
2021-08-07 18:03:21 +02:00
David Pedersen d7d97a613e Adjust Json docs 2021-08-07 16:10:07 +02:00
Sunli 345163e98d Common JSON wrapper type for response and request (#140) 2021-08-07 16:07:13 +02:00