add static files
we have a favicon now :') Signed-off-by: Gunwant Jain <mail@wantguns.dev>
This commit is contained in:
parent
1175a57539
commit
c6262e9e87
|
@ -1,6 +1,6 @@
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate rocket;
|
extern crate rocket;
|
||||||
use rocket::shield::{Shield, NoSniff};
|
use rocket::shield::{NoSniff, Shield};
|
||||||
use rocket_dyn_templates::Template;
|
use rocket_dyn_templates::Template;
|
||||||
|
|
||||||
mod models;
|
mod models;
|
||||||
|
@ -15,6 +15,7 @@ fn rocket() -> _ {
|
||||||
"/",
|
"/",
|
||||||
routes![
|
routes![
|
||||||
routes::index::index,
|
routes::index::index,
|
||||||
|
routes::static_files::static_files,
|
||||||
routes::upload::upload,
|
routes::upload::upload,
|
||||||
routes::submit::submit,
|
routes::submit::submit,
|
||||||
routes::retrieve::retrieve,
|
routes::retrieve::retrieve,
|
||||||
|
|
|
@ -3,4 +3,5 @@ pub mod pretty_retrieve;
|
||||||
pub mod pretty_retrieve_ext;
|
pub mod pretty_retrieve_ext;
|
||||||
pub mod submit;
|
pub mod submit;
|
||||||
pub mod upload;
|
pub mod upload;
|
||||||
pub mod retrieve;
|
pub mod retrieve;
|
||||||
|
pub mod static_files;
|
||||||
|
|
7
src/routes/static_files.rs
Normal file
7
src/routes/static_files.rs
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
use std::path::{Path, PathBuf};
|
||||||
|
use rocket::fs::NamedFile;
|
||||||
|
|
||||||
|
#[get("/<file..>", rank = 3)]
|
||||||
|
pub async fn static_files(file: PathBuf) -> Option<NamedFile> {
|
||||||
|
NamedFile::open(Path::new("static/").join(file)).await.ok()
|
||||||
|
}
|
BIN
static/android-chrome-192x192.png
Normal file
BIN
static/android-chrome-192x192.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 593 B |
BIN
static/android-chrome-512x512.png
Normal file
BIN
static/android-chrome-512x512.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.1 KiB |
BIN
static/apple-touch-icon.png
Normal file
BIN
static/apple-touch-icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 563 B |
BIN
static/favicon-16x16.png
Normal file
BIN
static/favicon-16x16.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 83 B |
BIN
static/favicon-32x32.png
Normal file
BIN
static/favicon-32x32.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 104 B |
BIN
static/favicon.ico
Normal file
BIN
static/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 15 KiB |
1
static/site.webmanifest
Normal file
1
static/site.webmanifest
Normal file
|
@ -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"}
|
Loading…
Reference in New Issue
Block a user