refactor: bring in the modules

Signed-off-by: Gunwant Jain <mail@wantguns.dev>
This commit is contained in:
Gunwant Jain 2021-07-11 03:07:50 +05:30
commit 9c5a3af128
12 changed files with 145 additions and 118 deletions

10
src/routes/retrieve.rs Normal file
View file

@ -0,0 +1,10 @@
use std::fs::File;
use crate::models::paste_id::PasteId;
#[get("/<id>")]
pub async fn retrieve(id: PasteId<'_>) -> Option<File> {
let filename = format!("upload/{id}", id = id);
File::open(&filename).ok()
}