mirror of
https://github.com/actix/examples
synced 2025-06-28 09:50:36 +02:00
Update to master (#90)
This commit is contained in:
@ -6,7 +6,7 @@ edition = "2018"
|
||||
workspace = ".."
|
||||
|
||||
[dependencies]
|
||||
actix-web = { git="https://github.com/actix/actix-web.git", branch = "1.0" }
|
||||
actix-web = { git="https://github.com/actix/actix-web.git" }
|
||||
|
||||
serde = "1.0"
|
||||
serde_derive = "1.0"
|
||||
|
@ -12,10 +12,10 @@ struct AppState {
|
||||
fn main() -> std::io::Result<()> {
|
||||
HttpServer::new(|| {
|
||||
App::new()
|
||||
.state(AppState {
|
||||
.data(AppState {
|
||||
foo: "bar".to_string(),
|
||||
})
|
||||
.middleware(middleware::Logger::default())
|
||||
.wrap(middleware::Logger::default())
|
||||
.service(web::resource("/").route(web::get().to(index)))
|
||||
.service(web::resource("/post1").route(web::post().to(handle_post_1)))
|
||||
.service(web::resource("/post2").route(web::post().to(handle_post_2)))
|
||||
|
Reference in New Issue
Block a user