Skip to content

Commit

Permalink
fix quickstart example (#691)
Browse files Browse the repository at this point in the history
Co-authored-by: Sunli <[email protected]>
  • Loading branch information
DrRac27 and sunli829 authored Nov 19, 2023
1 parent bb8571b commit 1643d7a
Showing 1 changed file with 11 additions and 10 deletions.
21 changes: 11 additions & 10 deletions poem-openapi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,16 +55,17 @@
//! }
//! }
//!
//! let api_service =
//! OpenApiService::new(Api, "Hello World", "1.0").server("http://localhost:3000");
//! let ui = api_service.swagger_ui();
//! let app = Route::new().nest("/", api_service).nest("/docs", ui);
//!
//! # tokio::runtime::Runtime::new().unwrap().block_on(async {
//! Server::new(TcpListener::bind("0.0.0.0:3000"))
//! .run(app)
//! .await;
//! # });
//! #[tokio::main]
//! async fn main() {
//! let api_service =
//! OpenApiService::new(Api, "Hello World", "1.0").server("http://localhost:3000");
//! let ui = api_service.swagger_ui();
//! let app = Route::new().nest("/", api_service).nest("/docs", ui);
//!
//! Server::new(TcpListener::bind("127.0.0.1:3000"))
//! .run(app)
//! .await;
//! }
//! ```
//!
//! ## Check it
Expand Down

0 comments on commit 1643d7a

Please sign in to comment.