aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.rs
diff options
context:
space:
mode:
authorboastful-squirrel <boastful.squirrel@gmail.com>2019-04-27 10:12:42 +0000
committerboastful-squirrel <boastful.squirrel@gmail.com>2019-04-27 10:12:42 +0000
commitfd3392636ce013cf8193a0881fa08680a8239698 (patch)
tree463ef6ebfbf7f338bd689a2e24b107294c7cee5d /src/main.rs
parentMade ColorScheme, SortingMethod and SortingOrder enums derive Copy (diff)
downloadminiserve-fd3392636ce013cf8193a0881fa08680a8239698.tar.gz
miniserve-fd3392636ce013cf8193a0881fa08680a8239698.zip
Themed errors
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index a9d44df..bd71763 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -274,9 +274,11 @@ fn configure_app(app: App<MiniserveConfig>) -> App<MiniserveConfig> {
if let Some(s) = s {
if app.state().file_upload {
+ let default_color_scheme = app.state().default_color_scheme;
// Allow file upload
- app.resource(&upload_route, |r| {
- r.method(Method::POST).f(file_upload::upload_file)
+ app.resource(&upload_route, move |r| {
+ r.method(Method::POST)
+ .f(move |file| file_upload::upload_file(file, default_color_scheme))
})
// Handle directories
.handler(&full_route, s)