2018-03-31 08:37:15 +02:00
|
|
|
use actix_web::{AsyncResponder, Error, HttpMessage, HttpResponse, HttpRequest};
|
2018-01-27 04:51:13 +01:00
|
|
|
use futures::Future;
|
|
|
|
|
2018-01-27 04:00:26 +01:00
|
|
|
|
|
|
|
#[derive(Deserialize,Serialize, Debug)]
|
|
|
|
struct Info {
|
|
|
|
username: String,
|
|
|
|
email: String,
|
|
|
|
password: String,
|
|
|
|
confirm_password: String,
|
|
|
|
}
|
2018-01-27 04:51:13 +01:00
|
|
|
|
|
|
|
pub fn info(req: HttpRequest) -> Box<Future<Item=HttpResponse, Error=Error>> {
|
2018-03-31 03:54:38 +02:00
|
|
|
req.json()
|
2018-01-27 04:51:13 +01:00
|
|
|
.from_err()
|
|
|
|
.and_then(|res: Info| {
|
2018-03-31 08:07:33 +02:00
|
|
|
Ok(HttpResponse::Ok().json(res))
|
2018-01-27 04:51:13 +01:00
|
|
|
}).responder()
|
2018-01-27 04:00:26 +01:00
|
|
|
}
|