mirror of
https://github.com/tokio-rs/axum.git
synced 2024-12-28 15:30:16 +01:00
Fix localhost vs 0.0.0.0 discrepancy (#1984)
This commit is contained in:
parent
b663072504
commit
b0eb7a24bc
2 changed files with 2 additions and 2 deletions
|
@ -53,7 +53,7 @@ async fn main() {
|
|||
// `POST /users` goes to `create_user`
|
||||
.route("/users", post(create_user));
|
||||
|
||||
// run our app with hyper
|
||||
// run our app with hyper, listening globally on port 3000
|
||||
let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap();
|
||||
axum::serve(listener, app).await.unwrap();
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
//! // build our application with a single route
|
||||
//! let app = Router::new().route("/", get(|| async { "Hello, World!" }));
|
||||
//!
|
||||
//! // run it on localhost:3000
|
||||
//! // run our app with hyper, listening globally on port 3000
|
||||
//! let listener = tokio::net::TcpListener::bind("0.0.0.0:3000").await.unwrap();
|
||||
//! axum::serve(listener, app).await.unwrap();
|
||||
//! }
|
||||
|
|
Loading…
Reference in a new issue