diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/src/main.rs b/src/main.rs index 39a4a5a..5a0b050 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,24 +1,27 @@ #![feature(box_syntax)] -use std::fs::read_to_string; - use crate::frontend::{pages::ContentType, style::CSS_BUNDLE}; use actix_web::{get, web, App, HttpServer, Responder}; use database::Database; use frontend::pages::{home::page_home, node::page_library_node}; use library::Library; +use std::fs::read_to_string; pub mod database; pub mod frontend; pub mod library; +pub mod metadata; #[get("/assets/style.css")] async fn assets_style() -> impl Responder { - // ContentType("text/css", CSS_BUNDLE) - ContentType( - "text/css", - read_to_string("src/frontend/style/layout.css").unwrap(), - ) + if cfg!(debug_assertions) { + ContentType( + "text/css", + read_to_string("src/frontend/style/layout.css").unwrap(), + ) + } else { + ContentType("text/css", CSS_BUNDLE.to_string()) + } } pub struct AppState { |