From 80e668f9cda3eb7972198dbbc65f6f72eae43c99 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Tue, 10 Jan 2023 19:52:01 +0100 Subject: replacing actix with rocket --- src/main.rs | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) (limited to 'src/main.rs') 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 { -- cgit v1.2.3-70-g09d2