beet_server 0.0.6

Serve applications with axum and deploy with cargo-lambda.
Documentation
use bytes::Bytes;
use http_body_util::BodyExt;


pub struct AxumExt;



impl AxumExt {
	pub async fn collect_response(
		res: axum::response::Response,
	) -> Result<http::Response<Bytes>, axum::Error> {
		let (parts, body) = res.into_parts();

		let body = body.collect().await.map(|b| b.to_bytes())?;

		let res = http::Response::from_parts(parts, body);
		Ok(res)
	}
}