mirror of
https://github.com/tokio-rs/axum.git
synced 2024-11-22 07:08:16 +01:00
Tweak readme example
This commit is contained in:
parent
c41c9e0f78
commit
97d9cb2ab7
1 changed files with 3 additions and 2 deletions
|
@ -32,7 +32,6 @@ on providing a core that is macro free.
|
|||
use awebframework::prelude::*;
|
||||
use hyper::Server;
|
||||
use std::net::SocketAddr;
|
||||
use tower::make::Shared;
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
|
@ -42,12 +41,14 @@ async fn main() {
|
|||
// run it with hyper on localhost:3000
|
||||
let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
|
||||
Server::bind(&addr)
|
||||
.serve(Shared::new(app))
|
||||
.serve(app.into_make_service())
|
||||
.await
|
||||
.unwrap();
|
||||
}
|
||||
```
|
||||
|
||||
See the [crate documentation][docs] for way more examples.
|
||||
|
||||
## Examples
|
||||
|
||||
The [examples] folder contains various examples of how to use awebframework. The
|
||||
|
|
Loading…
Reference in a new issue