removing old depracated routes/features
This commit is contained in:
parent
a1402e79bb
commit
9f586c2569
@ -1,59 +0,0 @@
|
|||||||
// Basic router for that server's general website page.
|
|
||||||
// All new servers come with this as a default so that
|
|
||||||
use rocket_contrib::templates::Template;
|
|
||||||
use rocket::response::NamedFile;
|
|
||||||
use std::path::Path;
|
|
||||||
use serde_derive::Deserialize;
|
|
||||||
|
|
||||||
// Purely for backend purposes
|
|
||||||
#[derive(Serialize, Deserialize, Debug)]
|
|
||||||
pub struct WebsiteConfig {
|
|
||||||
stylesheet: String,
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#[get("/")]
|
|
||||||
pub fn homepage() -> Template {
|
|
||||||
Template::render("index", WebsiteConfig {
|
|
||||||
stylesheet: "/static/css/index.css".to_string()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
#[get("/about")]
|
|
||||||
pub fn about_page() -> Template {
|
|
||||||
Template::render("about", WebsiteConfig {
|
|
||||||
stylesheet: "/static/css/about.css".to_string()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
#[get("/servers")]
|
|
||||||
pub fn server_info() -> Template {
|
|
||||||
Template::render("servers", WebsiteConfig {
|
|
||||||
stylesheet: "/static/css/about.css".to_string()
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
#[get("/static/css/<file>")]
|
|
||||||
pub fn static_css(file: String) -> Option<NamedFile> {
|
|
||||||
let mut f = file;
|
|
||||||
f = f.replace("..", "");
|
|
||||||
f = f.replace("%2e", "");
|
|
||||||
NamedFile::open(Path::new("static/css/").join(f)).ok()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[get("/static/js/<file>")]
|
|
||||||
pub fn static_js(file: String) -> Option<NamedFile> {
|
|
||||||
let mut f = file;
|
|
||||||
f = f.replace("..", "");
|
|
||||||
f = f.replace("%2e", "");
|
|
||||||
NamedFile::open(Path::new("static/js/").join(f)).ok()
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
#[get("/static/media/<file>")]
|
|
||||||
pub fn static_media(file: String) -> Option<NamedFile> {
|
|
||||||
let mut f = file;
|
|
||||||
f = f.replace("..", "");
|
|
||||||
f = f.replace("%2e", "");
|
|
||||||
NamedFile::open(Path::new("static/media/").join(f)).ok()
|
|
||||||
}
|
|
Loading…
Reference in New Issue
Block a user