Finished /upload endpoint

This commit is contained in:
Random936
2024-12-23 17:47:33 -08:00
parent 0b2a4f130e
commit 7570739ba4
5 changed files with 103 additions and 8 deletions

View File

@@ -6,7 +6,7 @@ use tokio::net::TcpListener;
use tower_http::services::ServeDir;
use axum::{
middleware,
routing::get,
routing::{get, post},
Router
};
@@ -15,6 +15,7 @@ mod print_dir;
mod config;
mod shells;
mod logging;
mod upload;
#[tokio::main]
async fn main() {
@@ -30,7 +31,7 @@ async fn main() {
print_dir::print_interface(&args.interface, &port, &args.directory);
let app = Router::new()
//.route("/upload", post(upload_handler))
.route("/upload", post(upload::upload_handler))
.route("/shells/:shell", get(shells::shells_handler))
.nest_service("/download", ServeDir::new(conf.get_download_path()))
.nest_service("/", ServeDir::new(cwd))