2016-09-12 08:51:02 +00:00
|
|
|
use std::path::{Path, PathBuf};
|
|
|
|
|
2019-09-10 04:54:41 +00:00
|
|
|
use rocket::response::NamedFile;
|
|
|
|
|
2016-09-12 08:51:02 +00:00
|
|
|
#[get("/")]
|
2019-09-10 04:54:41 +00:00
|
|
|
pub fn index() -> Option<NamedFile> {
|
|
|
|
NamedFile::open("static/index.html").ok()
|
2016-07-16 04:09:08 +00:00
|
|
|
}
|
|
|
|
|
2016-10-12 07:14:42 +00:00
|
|
|
#[get("/<file..>", rank = 2)]
|
2019-09-10 04:54:41 +00:00
|
|
|
pub fn files(file: PathBuf) -> Option<NamedFile> {
|
|
|
|
NamedFile::open(Path::new("static/").join(file)).ok()
|
2016-07-16 04:09:08 +00:00
|
|
|
}
|