Start of streaming shiz
This commit is contained in:
parent
828ee6c533
commit
910711a0f0
3 changed files with 26 additions and 5 deletions
14
src/main.rs
14
src/main.rs
|
|
@ -5,9 +5,12 @@ use axum::{
|
|||
routing::{get_service, post},
|
||||
Router,
|
||||
};
|
||||
use futures_util::TryStreamExt;
|
||||
use hyper::{Body, Request};
|
||||
use std::io::ErrorKind;
|
||||
use std::net::SocketAddr;
|
||||
use tar::Archive;
|
||||
use tokio_util::io::StreamReader;
|
||||
use tower_http::{auth::RequireAuthorizationLayer, services::ServeDir, trace::TraceLayer};
|
||||
use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
|
||||
|
||||
|
|
@ -54,9 +57,10 @@ async fn main() {
|
|||
.unwrap();
|
||||
}
|
||||
|
||||
async fn post_deploy(body: BodyStream) {
|
||||
// let tar = GzDecoder::new(body);
|
||||
let tar = GzipDecoder::new(body);
|
||||
let mut archive = Archive::new(tar);
|
||||
archive.unpack("./static").unwrap();
|
||||
async fn post_deploy(res: BodyStream) {
|
||||
let mut read =
|
||||
StreamReader::new(res.map_err(|axum_err| std::io::Error::new(ErrorKind::Other, axum_err)));
|
||||
// let tar = GzipDecoder::new(body);
|
||||
// let mut archive = Archive::new(tar);
|
||||
// archive.unpack("./static").unwrap();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue