mirror of
https://github.com/tokio-rs/axum.git
synced 2026-08-20 00:00:11 +02:00
Fix localhost vs 0.0.0.0 discrepancy (#1984)
This commit is contained in:
+1
-1
@@ -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();
|
||||
}
|
||||
|
||||
+1
-1
@@ -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();
|
||||
//! }
|
||||
|
||||
Reference in New Issue
Block a user