diff options
author | metamuffin <metamuffin@disroot.org> | 2023-01-10 19:52:01 +0100 |
---|---|---|
committer | metamuffin <metamuffin@disroot.org> | 2023-01-10 19:52:01 +0100 |
commit | 80e668f9cda3eb7972198dbbc65f6f72eae43c99 (patch) | |
tree | 7682be9916003edea648179911f04381a971751c /src/main.rs | |
parent | 1c97c3785047d50fd5500f99457a254e0f95aefe (diff) | |
download | jellything-80e668f9cda3eb7972198dbbc65f6f72eae43c99.tar jellything-80e668f9cda3eb7972198dbbc65f6f72eae43c99.tar.bz2 jellything-80e668f9cda3eb7972198dbbc65f6f72eae43c99.tar.zst |
replacing actix with rocket
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 { |