aboutsummaryrefslogtreecommitdiff
path: root/server/src/assets.rs
diff options
context:
space:
mode:
Diffstat (limited to 'server/src/assets.rs')
-rw-r--r--server/src/assets.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/server/src/assets.rs b/server/src/assets.rs
index cf6ccb1..7195fbf 100644
--- a/server/src/assets.rs
+++ b/server/src/assets.rs
@@ -15,8 +15,8 @@ macro_rules! s_file {
#[cfg(debug_assertions)]
#[macro_export]
macro_rules! s_asset_dir {
- () => {
- warp::fs::dir("../client-web/public/assets")
+ ($path: literal) => {
+ warp::fs::dir(concat!("../", $path))
};
}
@@ -37,9 +37,9 @@ macro_rules! s_file {
#[cfg(not(debug_assertions))]
#[macro_export]
macro_rules! s_asset_dir {
- () => {{
+ ($path:literal) => {{
use include_dir::{include_dir, Dir};
- const DIR: Dir = include_dir!("$CARGO_MANIFEST_DIR/../client-web/public/assets");
+ const DIR: Dir = include_dir!(concat!("$CARGO_MANIFEST_DIR/../", $path));
warp::path::tail().and_then(|t: warp::path::Tail| async move {
let path = t.as_str();
let content_type = match &path {
@@ -47,6 +47,7 @@ macro_rules! s_asset_dir {
_ if path.ends_with(".js") => "application/javascript",
_ if path.ends_with(".css") => "text/css",
_ if path.ends_with(".svg") => "image/svg+xml",
+ _ if path.ends_with(".ini") => "text/plain",
_ => "application/octet-stream",
};
DIR.get_file(path)