|
|
|
@ -1,4 +1,3 @@
|
|
|
|
|
use rapid_web::actix::web::Bytes;
|
|
|
|
|
use rapid_web::actix::HttpResponse;
|
|
|
|
|
use rapid_web::rapid_web_codegen::rapid_handler;
|
|
|
|
|
|
|
|
|
@ -6,8 +5,7 @@ pub const ROUTE_KEY: &str = "echo";
|
|
|
|
|
pub type RapidOutput = String;
|
|
|
|
|
|
|
|
|
|
#[rapid_handler]
|
|
|
|
|
pub async fn post(bytes: Bytes) -> HttpResponse {
|
|
|
|
|
let body = String::from_utf8(bytes.to_vec()).unwrap();
|
|
|
|
|
println!("Body: {}", &body);
|
|
|
|
|
pub async fn post(body: String) -> HttpResponse {
|
|
|
|
|
println!("Body: {}", body);
|
|
|
|
|
HttpResponse::Ok().body(body)
|
|
|
|
|
}
|
|
|
|
|