From 8033985cb419b599a041c49955b3bb26bab30079 Mon Sep 17 00:00:00 2001 From: DrRac27 Date: Tue, 14 Nov 2023 15:22:27 +0100 Subject: [PATCH] fix quickstart example --- poem-openapi/src/lib.rs | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) 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