Commit Graph
20 Commits
Author SHA1 Message Date
Jonas PlatteandDavid Pedersen 84c3960639 Make serve generic over the listener and IO types (#2941)
Co-authored-by: David Pedersen <[email protected]>
2024-11-30 23:47:13 +01:00
Benjamin SparksandBenjamin Sparks c5a451d94b Remove unneeded macro usage (#2995)
Co-authored-by: Benjamin Sparks <[email protected]>
2024-10-17 16:47:51 +02:00
Benjamin Sparks 6efcb75d99 Fix warnings and errors from beta Rust (#2904) 2024-09-09 18:55:15 +00:00
David Pedersen e63cc49f55 Update unix-domain-socket, listen-multiple-addrs, and testing examples (#2358) 2023-11-27 10:23:52 +01:00
43b14a5f02 Update to latest versions of hyper and http-body (#1882)
Co-authored-by: Michael Scofield <[email protected]>
Co-authored-by: Jonas Platte <[email protected]>
2023-11-23 11:03:03 +00:00
Yuri Astrakhan 786329d85d Use inline format args (#2232) 2023-09-19 06:51:57 +00:00
David Pedersen c97967252d Add serve function and remove Server re-export (#1868) 2023-04-21 17:45:31 +02:00
Jonas PlatteandDavid Pedersen dc480f7b0e Re-integrate examples into the root workspace (#1466)
Co-authored-by: David Pedersen <[email protected]>
2023-03-10 12:02:11 +01:00
tottoto 6c133be5b7 Refactor initializing tracing-subscriber in examples (#1596)
* Refactor initializing tracing-subscriber

* Revert "Refactor initializing tracing-subscriber"

This reverts commit 0876260bf9 in favor of tracing_subscriber::registry.

* Use EnvFilter::try_from_default_env in chat example

* Use EnvFilter::try_from_default_env in examples
2022-11-30 10:46:19 +01: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
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 <[email protected]>
Co-authored-by: zys864 <[email protected]>
2022-04-08 11:29:52 +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
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
Jonas Platte 9c77ee0295 Use nightly clippy & rustfmt for more style checks (#487) 2021-11-09 11:53:57 +00: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 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
Andrei Zolkin 9df57e6ff2 Migrate all examples to use std::env::var_os (#312) 2021-09-12 17:39:43 +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 6c9651c14a Move all examples to their own crates (#201)
This makes it much clearer which dependencies each example has.
2021-08-18 00:49:01 +02:00