1
0
mirror of https://github.com/actix/examples synced 2024-12-12 14:13:11 +01:00
examples/cors/backend/src/user.rs
2022-06-08 03:53:38 +01:00

22 lines
554 B
Rust

use actix_web::{post, web};
use serde::{Deserialize, Serialize};
#[derive(Deserialize, Serialize, Debug)]
pub struct Info {
username: String,
email: String,
password: String,
confirm_password: String,
}
#[post("/user/info")]
pub async fn info(info: web::Json<Info>) -> web::Json<Info> {
println!("=========={info:?}=========");
web::Json(Info {
username: info.username.clone(),
email: info.email.clone(),
password: info.password.clone(),
confirm_password: info.confirm_password.clone(),
})
}