Implemented proxying of GSD requests

This commit is contained in:
Dennis Nemec
2025-09-30 21:55:53 +02:00
parent b95454458c
commit e8954ba5c1
14 changed files with 2589 additions and 2 deletions

26
src/api.rs Normal file
View File

@ -0,0 +1,26 @@
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 {
}