From ae2f654eebf39326a33957d136a6baaadc4bbfb6 Mon Sep 17 00:00:00 2001 From: Araozu Date: Sat, 26 Oct 2024 23:03:05 -0500 Subject: [PATCH] fix: use Path instead of relative! macro --- src/main.rs | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/main.rs b/src/main.rs index 3ed43da..5f3170c 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,10 +1,13 @@ #[macro_use] extern crate rocket; use core::time; -use std::time::{SystemTime, UNIX_EPOCH}; +use std::{ + path::Path, + time::{SystemTime, UNIX_EPOCH}, +}; use maud::{html, Markup, DOCTYPE}; -use rocket::fs::{relative, FileServer}; +use rocket::fs::FileServer; #[get("/")] fn index() -> Markup { @@ -135,9 +138,11 @@ fn skeleton(children: Markup) -> Markup { #[launch] fn rocket() -> _ { - std::thread::sleep(time::Duration::from_secs(360)); + std::thread::sleep(time::Duration::from_secs(30)); + + let static_files_path = Path::new("./public"); rocket::build() .mount("/", routes![index]) - .mount("/public", FileServer::from(relative!("public"))) + .mount("/public", FileServer::from(static_files_path)) }