aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorSven-Hendrik Haase <svenstaro@gmail.com>2019-04-07 12:38:25 +0000
committerGitHub <noreply@github.com>2019-04-07 12:38:25 +0000
commit0d97ce447f7af65b51bd21fd0fa08dac418ae6b7 (patch)
treef2ed914f358b875f96963b176d61fbfd6c2e672b /src/main.rs
parentMerge pull request #58 from vojta7/file_uploading (diff)
parentCargo fmt (diff)
downloadminiserve-0d97ce447f7af65b51bd21fd0fa08dac418ae6b7.tar.gz
miniserve-0d97ce447f7af65b51bd21fd0fa08dac418ae6b7.zip
Merge pull request #55 from boastful-squirrel/colorscheme
Color schemes
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index 0ca2fdf..a703b00 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -17,8 +17,9 @@ mod errors;
mod file_upload;
mod listing;
mod renderer;
+mod themes;
-#[derive(Clone, Debug)]
+#[derive(Clone)]
/// Configuration of the Miniserve application
pub struct MiniserveConfig {
/// Enable verbose mode
@@ -45,6 +46,9 @@ pub struct MiniserveConfig {
/// Enable random route generation
pub random_route: Option<String>,
+ /// Default color scheme
+ pub default_color_scheme: themes::ColorScheme,
+
/// Enable file upload
pub file_upload: bool,
@@ -187,6 +191,7 @@ fn configure_app(app: App<MiniserveConfig>) -> App<MiniserveConfig> {
let path = &app.state().path;
let no_symlinks = app.state().no_symlinks;
let random_route = app.state().random_route.clone();
+ let default_color_scheme = app.state().default_color_scheme.clone();
let file_upload = app.state().file_upload;
upload_route = match app.state().random_route.clone() {
Some(random_route) => format!("/{}/upload", random_route),
@@ -207,6 +212,7 @@ fn configure_app(app: App<MiniserveConfig>) -> App<MiniserveConfig> {
no_symlinks,
file_upload,
random_route.clone(),
+ default_color_scheme.clone(),
u_r.clone(),
)
}),