Alexey Velikiy
3 years ago
2 changed files with 25 additions and 17 deletions
@ -0,0 +1,17 @@
|
||||
use crate::api::API; |
||||
use crate::user_service; |
||||
|
||||
use warp::{Rejection, Reply}; |
||||
use warp::filters::method::post; |
||||
use warp::{Filter, http::Response }; |
||||
|
||||
|
||||
pub fn get_route() -> impl Filter<Extract = impl Reply, Error = Rejection> + Clone { |
||||
return warp::path!("api" / "auth" / "signin") |
||||
.and(post()) |
||||
.and(warp::body::json()) |
||||
.map(|user: user_service::User| { |
||||
let s = format!("Hello, {}!", &user.username); |
||||
API::builder(&s) |
||||
}); |
||||
} |
Loading…
Reference in new issue