refactor: bring in the modules
Signed-off-by: Gunwant Jain <mail@wantguns.dev>
This commit is contained in:
parent
8a3b29a0ef
commit
9c5a3af128
12 changed files with 145 additions and 118 deletions
10
src/routes/retrieve.rs
Normal file
10
src/routes/retrieve.rs
Normal 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()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue