From ad89fb7fc01f998d446d1c02ce6bacdda75ed2ba Mon Sep 17 00:00:00 2001 From: jabuxas Date: Sun, 16 Feb 2025 09:13:32 -0300 Subject: [PATCH] feat: add serving uni projects --- src/main.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index 9771af8..57489b3 100644 --- a/src/main.rs +++ b/src/main.rs @@ -3,7 +3,7 @@ extern crate rocket; use std::{borrow::Cow, ffi::OsStr, path::PathBuf}; -use rocket::{http::ContentType, response::content::RawHtml}; +use rocket::{fs::FileServer, http::ContentType, response::content::RawHtml}; use rust_embed::Embed; #[derive(Embed)] @@ -31,5 +31,7 @@ fn dist(file: PathBuf) -> Option<(ContentType, Cow<'static, [u8]>)> { #[launch] fn rocket() -> _ { - rocket::build().mount("/", routes![index, dist]) + rocket::build() + .mount("/", routes![index, dist]) + .mount("/projects", FileServer::from("./projects")) }