m/cup
1
0
mirror of https://github.com/sergi0g/cup.git synced 2025-11-08 05:03:49 -05:00

refactor: use Bytes to store constant blobs in the server

Might also improve performance.
This commit is contained in:
Sergio
2025-03-19 13:56:47 +02:00
parent e26f941c59
commit ccf825df24

View File

@@ -8,6 +8,7 @@ use tokio::sync::Mutex;
use tokio_cron_scheduler::{Job, JobScheduler};
use xitca_web::{
body::ResponseBody,
bytes::Bytes,
error::Error,
handler::{handler_service, path::PathRef, state::StateRef},
http::{StatusCode, WebResponse},
@@ -32,9 +33,9 @@ use crate::{
const HTML: &str = include_str!("static/index.html");
const JS: &str = include_str!("static/assets/index.js");
const CSS: &str = include_str!("static/assets/index.css");
const FAVICON_ICO: &[u8] = include_bytes!("static/favicon.ico");
const FAVICON_SVG: &[u8] = include_bytes!("static/favicon.svg");
const APPLE_TOUCH_ICON: &[u8] = include_bytes!("static/apple-touch-icon.png");
const FAVICON_ICO: Bytes = Bytes::from_static(include_bytes!("static/favicon.ico"));
const FAVICON_SVG: Bytes = Bytes::from_static(include_bytes!("static/favicon.svg"));
const APPLE_TOUCH_ICON: Bytes = Bytes::from_static(include_bytes!("static/apple-touch-icon.png"));
const SORT_ORDER: [&str; 8] = [
"monitored_images",