aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorwyhaya <wyhaya@gmail.com>2020-07-05 14:34:43 +0000
committerGitHub <noreply@github.com>2020-07-05 14:34:43 +0000
commit205a5a4cc49e33b86366969a76b3303d71287761 (patch)
tree5c8d73e8380356476cab85b770ab7d983011d639 /src/main.rs
parentMerge pull request #292 from j2ghz/patch-1 (diff)
downloadminiserve-205a5a4cc49e33b86366969a76b3303d71287761.tar.gz
miniserve-205a5a4cc49e33b86366969a76b3303d71287761.zip
Add generate QR code (#330)
* Add generate QR code * Add --qrcode option
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 3ff35c8..a9e7944 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -57,6 +57,9 @@ pub struct MiniserveConfig {
/// However, if a directory contains this file, miniserve will serve that file instead.
pub index: Option<std::path::PathBuf>,
+ /// Enable QR code display
+ pub show_qrcode: bool,
+
/// Enable file upload
pub file_upload: bool,
@@ -258,6 +261,7 @@ fn configure_app(app: App<MiniserveConfig>) -> App<MiniserveConfig> {
let no_symlinks = app.state().no_symlinks;
let random_route = app.state().random_route.clone();
let default_color_scheme = app.state().default_color_scheme;
+ let show_qrcode = app.state().show_qrcode;
let file_upload = app.state().file_upload;
let tar_enabled = app.state().tar_enabled;
let zip_enabled = app.state().zip_enabled;
@@ -288,6 +292,7 @@ fn configure_app(app: App<MiniserveConfig>) -> App<MiniserveConfig> {
file_upload,
random_route.clone(),
default_color_scheme,
+ show_qrcode,
u_r.clone(),
tar_enabled,
zip_enabled,