From 078909570443b5975bdcd4cfded891d9c2823096 Mon Sep 17 00:00:00 2001 From: philipp Date: Wed, 5 Apr 2023 19:24:02 +0200 Subject: [PATCH] add fileserver --- src/rest/mod.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/rest/mod.rs b/src/rest/mod.rs index 732e40b..6a466bf 100644 --- a/src/rest/mod.rs +++ b/src/rest/mod.rs @@ -1,6 +1,8 @@ use chrono::{Datelike, Duration, Local, NaiveDate}; use rocket::{ - catch, catchers, get, + catch, catchers, + fs::FileServer, + get, request::FlashMessage, response::{Flash, Redirect}, routes, Build, Rocket, State, @@ -75,6 +77,7 @@ pub fn start(db: SqlitePool) -> Rocket { .mount("/auth", auth::routes()) .mount("/cox", cox::routes()) .mount("/admin", admin::routes()) + .mount("/public", FileServer::from("static/")) .register("/", catchers![unauthorized_error]) .attach(Template::fairing()) }