diff options
author | Sven-Hendrik Haase <svenstaro@gmail.com> | 2025-03-07 11:38:10 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-03-07 11:38:10 +0000 |
commit | 419204c291273e073cb4e1049655bea848dbc441 (patch) | |
tree | 341cb7ac4bd5915deb8fe58947b3cc352687556d /src/config.rs | |
parent | Reformat style.scss (diff) | |
parent | Add asynchronous directory size counting (diff) | |
download | miniserve-419204c291273e073cb4e1049655bea848dbc441.tar.gz miniserve-419204c291273e073cb4e1049655bea848dbc441.zip |
Merge pull request #1482 from svenstaro/add-asynchronous-directory-size-loading
Add asynchronous directory size counting
Diffstat (limited to 'src/config.rs')
-rw-r--r-- | src/config.rs | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/config.rs b/src/config.rs index efec515..eecc45e 100644 --- a/src/config.rs +++ b/src/config.rs @@ -24,7 +24,7 @@ const ROUTE_ALPHABET: [char; 16] = [ '1', '2', '3', '4', '5', '6', '7', '8', '9', '0', 'a', 'b', 'c', 'd', 'e', 'f', ]; -#[derive(Clone)] +#[derive(Debug, Clone)] /// Configuration of the Miniserve application pub struct MiniserveConfig { /// Enable verbose mode @@ -66,6 +66,9 @@ pub struct MiniserveConfig { /// Well-known healthcheck route (prefixed if route_prefix is provided) pub healthcheck_route: String, + /// Well-known API route (prefixed if route_prefix is provided) + pub api_route: String, + /// Well-known favicon route (prefixed if route_prefix is provided) pub favicon_route: String, @@ -206,15 +209,17 @@ impl MiniserveConfig { // If --random-route is enabled, in order to not leak the random generated route, we must not use it // as static files prefix. // Otherwise, we should apply route_prefix to static files. - let (healthcheck_route, favicon_route, css_route) = if args.random_route { + let (healthcheck_route, api_route, favicon_route, css_route) = if args.random_route { ( "/__miniserve_internal/healthcheck".into(), + "/__miniserve_internal/api".into(), "/__miniserve_internal/favicon.svg".into(), "/__miniserve_internal/style.css".into(), ) } else { ( format!("{}/{}", route_prefix, "__miniserve_internal/healthcheck"), + format!("{}/{}", route_prefix, "__miniserve_internal/api"), format!("{}/{}", route_prefix, "__miniserve_internal/favicon.svg"), format!("{}/{}", route_prefix, "__miniserve_internal/style.css"), ) @@ -305,6 +310,7 @@ impl MiniserveConfig { default_sorting_order: args.default_sorting_order, route_prefix, healthcheck_route, + api_route, favicon_route, css_route, default_color_scheme, |