Compare commits

..

No commits in common. "4add9bcc8d5cd663a8cf5e9b2608784691f525f1" and "1db02076f3ece3d6d5eb604a07bea6c73666dfb3" have entirely different histories.

3 changed files with 0 additions and 17 deletions

View file

@ -38,7 +38,6 @@ async fn main() -> anyhow::Result<()> {
});
let router = Router::default()
.route("/", get(routes::root))
.route("/i/:id", get(routes::i))
.route("/i/:id", delete(routes::delete))
.route("/api/upload", post(routes::upload))

View file

@ -1,11 +1,9 @@
mod delete;
mod i;
mod new_key;
mod root;
mod upload;
pub use delete::delete;
pub use i::get as i;
pub use new_key::post as new_key;
pub use root::get as root;
pub use upload::post as upload;

View file

@ -1,14 +0,0 @@
use crate::state::ReqState;
use axum::{extract::State, response::IntoResponse};
use hyper::StatusCode;
pub async fn get(State(state): ReqState) -> impl IntoResponse {
let file_count = state.files_dir.read_dir();
if file_count.is_err() {
return Err(StatusCode::INTERNAL_SERVER_ERROR);
}
let file_count = file_count.unwrap().count();
Ok("u".repeat(file_count).into_response())
}