diff --git a/src/main.rs b/src/main.rs index a56916d..7d644eb 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,6 +1,6 @@ #[macro_use] extern crate rocket; -use rocket::shield::{Shield, NoSniff}; +use rocket::shield::{NoSniff, Shield}; use rocket_dyn_templates::Template; mod models; @@ -15,6 +15,7 @@ fn rocket() -> _ { "/", routes![ routes::index::index, + routes::static_files::static_files, routes::upload::upload, routes::submit::submit, routes::retrieve::retrieve, diff --git a/src/routes/mod.rs b/src/routes/mod.rs index db45145..cb2551e 100644 --- a/src/routes/mod.rs +++ b/src/routes/mod.rs @@ -3,4 +3,5 @@ pub mod pretty_retrieve; pub mod pretty_retrieve_ext; pub mod submit; pub mod upload; -pub mod retrieve; \ No newline at end of file +pub mod retrieve; +pub mod static_files; diff --git a/src/routes/static_files.rs b/src/routes/static_files.rs new file mode 100644 index 0000000..7aceded --- /dev/null +++ b/src/routes/static_files.rs @@ -0,0 +1,7 @@ +use std::path::{Path, PathBuf}; +use rocket::fs::NamedFile; + +#[get("/", rank = 3)] +pub async fn static_files(file: PathBuf) -> Option { + NamedFile::open(Path::new("static/").join(file)).await.ok() +} diff --git a/static/android-chrome-192x192.png b/static/android-chrome-192x192.png new file mode 100644 index 0000000..cd3a451 Binary files /dev/null and b/static/android-chrome-192x192.png differ diff --git a/static/android-chrome-512x512.png b/static/android-chrome-512x512.png new file mode 100644 index 0000000..01547f2 Binary files /dev/null and b/static/android-chrome-512x512.png differ diff --git a/static/apple-touch-icon.png b/static/apple-touch-icon.png new file mode 100644 index 0000000..01df788 Binary files /dev/null and b/static/apple-touch-icon.png differ diff --git a/static/favicon-16x16.png b/static/favicon-16x16.png new file mode 100644 index 0000000..8ae5da4 Binary files /dev/null and b/static/favicon-16x16.png differ diff --git a/static/favicon-32x32.png b/static/favicon-32x32.png new file mode 100644 index 0000000..0ad9043 Binary files /dev/null and b/static/favicon-32x32.png differ diff --git a/static/favicon.ico b/static/favicon.ico new file mode 100644 index 0000000..0caa54b Binary files /dev/null and b/static/favicon.ico differ diff --git a/static/site.webmanifest b/static/site.webmanifest new file mode 100644 index 0000000..45dc8a2 --- /dev/null +++ b/static/site.webmanifest @@ -0,0 +1 @@ +{"name":"","short_name":"","icons":[{"src":"/android-chrome-192x192.png","sizes":"192x192","type":"image/png"},{"src":"/android-chrome-512x512.png","sizes":"512x512","type":"image/png"}],"theme_color":"#ffffff","background_color":"#ffffff","display":"standalone"} \ No newline at end of file