mirror of
https://github.com/tokio-rs/axum.git
synced 2024-11-22 15:17:18 +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 awebframework::prelude::*;
|
||||||
use hyper::Server;
|
use hyper::Server;
|
||||||
use std::net::SocketAddr;
|
use std::net::SocketAddr;
|
||||||
use tower::make::Shared;
|
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() {
|
async fn main() {
|
||||||
|
@ -42,12 +41,14 @@ async fn main() {
|
||||||
// run it with hyper on localhost:3000
|
// run it with hyper on localhost:3000
|
||||||
let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
|
let addr = SocketAddr::from(([127, 0, 0, 1], 3000));
|
||||||
Server::bind(&addr)
|
Server::bind(&addr)
|
||||||
.serve(Shared::new(app))
|
.serve(app.into_make_service())
|
||||||
.await
|
.await
|
||||||
.unwrap();
|
.unwrap();
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
See the [crate documentation][docs] for way more examples.
|
||||||
|
|
||||||
## Examples
|
## Examples
|
||||||
|
|
||||||
The [examples] folder contains various examples of how to use awebframework. The
|
The [examples] folder contains various examples of how to use awebframework. The
|
||||||
|
|
Loading…
Reference in a new issue