diff --git a/poem-openapi/src/lib.rs b/poem-openapi/src/lib.rs index fd4fb4dca4..9e450234e0 100644 --- a/poem-openapi/src/lib.rs +++ b/poem-openapi/src/lib.rs @@ -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("127.0.0.1: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