mirror of
https://github.com/actix/actix-website
synced 2025-06-27 07:29:02 +02:00
update examples to v4 (#258)
This commit is contained in:
@ -6,6 +6,6 @@ edition = "2018"
|
||||
[dependencies]
|
||||
serde = "1.0"
|
||||
serde_json = "1.0"
|
||||
actix-web = "3"
|
||||
actix-web = "4"
|
||||
futures = "0.3.1"
|
||||
actix-multipart = "0.3"
|
||||
|
@ -20,7 +20,7 @@ async fn index(info: web::Json<Info>) -> Result<String> {
|
||||
#[actix_web::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
HttpServer::new(|| App::new().route("/", web::post().to(index)))
|
||||
.bind("127.0.0.1:8080")?
|
||||
.bind(("127.0.0.1", 8080))?
|
||||
.run()
|
||||
.await
|
||||
}
|
||||
|
@ -35,7 +35,7 @@ async fn main() -> std::io::Result<()> {
|
||||
use actix_web::HttpServer;
|
||||
|
||||
HttpServer::new(|| App::new().service(index_manual))
|
||||
.bind("127.0.0.1:8080")?
|
||||
.bind(("127.0.0.1", 8080))?
|
||||
.run()
|
||||
.await
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ async fn main() -> std::io::Result<()> {
|
||||
use actix_web::{App, HttpServer};
|
||||
|
||||
HttpServer::new(|| App::new().service(index))
|
||||
.bind("127.0.0.1:8080")?
|
||||
.bind(("127.0.0.1", 8080))?
|
||||
.run()
|
||||
.await
|
||||
}
|
||||
|
@ -18,7 +18,7 @@ async fn main() -> std::io::Result<()> {
|
||||
use actix_web::{App, HttpServer};
|
||||
|
||||
HttpServer::new(|| App::new().service(index))
|
||||
.bind("127.0.0.1:8080")?
|
||||
.bind(("127.0.0.1", 8080))?
|
||||
.run()
|
||||
.await
|
||||
}
|
||||
|
Reference in New Issue
Block a user