Serve the static files from the stoptime_ui crate

Do this on the root path (/), not on /static.
This commit is contained in:
Paul van Tilburg 2019-07-26 14:24:18 +02:00
parent 05a96934f3
commit 6a70bbb13e
1 changed files with 2 additions and 3 deletions

View File

@ -11,11 +11,11 @@ pub mod catchers;
pub mod handlers;
fn rocket() -> Rocket {
let static_dir = concat!(env!("CARGO_MANIFEST_DIR"), "/static");
let static_dir = concat!(env!("CARGO_MANIFEST_DIR"), "/../ui/static");
let static_files = StaticFiles::from(static_dir);
rocket::ignite()
.mount("/", routes![handlers::index])
.mount("/", static_files)
.mount(
"/company",
routes![handlers::company::index, handlers::company::create],
@ -41,7 +41,6 @@ fn rocket() -> Rocket {
],
)
.mount("/invoices", routes![handlers::invoices::index])
.mount("/static", static_files)
.mount(
"/timeline",
routes![