mirror of
https://github.com/fafhrd91/actix-web
synced 2025-07-01 08:45:10 +02:00
Rename HttpServer::start() to HttpServer::run()
This commit is contained in:
@ -20,7 +20,7 @@
|
||||
//! web::resource("/{name}/{id}/index.html").to(index))
|
||||
//! )
|
||||
//! .bind("127.0.0.1:8080")?
|
||||
//! .start()
|
||||
//! .run()
|
||||
//! .await
|
||||
//! }
|
||||
//! ```
|
||||
|
@ -38,21 +38,17 @@ struct Config {
|
||||
///
|
||||
/// Create new http server with application factory.
|
||||
///
|
||||
/// ```rust
|
||||
/// use std::io;
|
||||
/// ```rust,no_run
|
||||
/// use actix_web::{web, App, HttpResponse, HttpServer};
|
||||
///
|
||||
/// fn main() -> io::Result<()> {
|
||||
/// let sys = actix_rt::System::new("example"); // <- create Actix runtime
|
||||
///
|
||||
/// #[actix_rt::main]
|
||||
/// async fn main() -> std::io::Result<()> {
|
||||
/// HttpServer::new(
|
||||
/// || App::new()
|
||||
/// .service(web::resource("/").to(|| HttpResponse::Ok())))
|
||||
/// .bind("127.0.0.1:59090")?
|
||||
/// .start();
|
||||
///
|
||||
/// # actix_rt::System::current().stop();
|
||||
/// sys.run()
|
||||
/// .run()
|
||||
/// .await
|
||||
/// }
|
||||
/// ```
|
||||
pub struct HttpServer<F, I, S, B>
|
||||
@ -557,11 +553,11 @@ where
|
||||
/// async fn main() -> io::Result<()> {
|
||||
/// HttpServer::new(|| App::new().service(web::resource("/").to(|| HttpResponse::Ok())))
|
||||
/// .bind("127.0.0.1:0")?
|
||||
/// .start()
|
||||
/// .run()
|
||||
/// .await
|
||||
/// }
|
||||
/// ```
|
||||
pub fn start(self) -> Server {
|
||||
pub fn run(self) -> Server {
|
||||
self.builder.start()
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user