27 lines
671 B
Rust
27 lines
671 B
Rust
use crate::middleware::AppState;
|
|
use axum::Extension;
|
|
use axum::extract::Request;
|
|
use axum::response::IntoResponse;
|
|
use http::StatusCode;
|
|
use log::error;
|
|
use std::sync::Arc;
|
|
use axum::body::Body;
|
|
|
|
pub async fn handle_post(
|
|
Extension(state): Extension<Arc<AppState>>,
|
|
request: Request<Body>,
|
|
) -> impl IntoResponse {
|
|
match state.clone().gsd_service.forward_post_request(request).await {
|
|
Ok(e) => e.text().await.unwrap().into_response(),
|
|
|
|
Err(e) => {
|
|
error!("Failed to forward post: {:?}", e);
|
|
StatusCode::INTERNAL_SERVER_ERROR.into_response()
|
|
}
|
|
}
|
|
}
|
|
|
|
pub async fn handle_login() -> impl IntoResponse {
|
|
|
|
}
|