From ca5a2b6e222ff556b8bcab4f20ec9fecc4e81bc9 Mon Sep 17 00:00:00 2001 From: Till Hoeppner Date: Wed, 26 Nov 2014 23:27:57 +0100 Subject: Change defaults, errors and build setup --- Cargo.lock | 16 ++++++++++++++++ Cargo.toml | 4 ++++ default.json | 2 +- src/sersve.rs | 2 +- 4 files changed, 22 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index cf563f8..30fde82 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,7 +2,9 @@ name = "sersve" version = "0.0.1" dependencies = [ + "glob 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", "iron 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "persistent 0.0.1 (git+https://github.com/iron/persistent)", ] [[package]] @@ -28,6 +30,11 @@ name = "gcc" version = "0.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "glob" +version = "0.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "hyper" version = "0.0.5" @@ -93,6 +100,15 @@ dependencies = [ "pkg-config 0.0.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "persistent" +version = "0.0.1" +source = "git+https://github.com/iron/persistent#a201b8d3e1ef277108b0968c4f3d8eeecfff9444" +dependencies = [ + "iron 0.0.5 (registry+https://github.com/rust-lang/crates.io-index)", + "plugin 0.0.0 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "phantom" version = "0.0.1" diff --git a/Cargo.toml b/Cargo.toml index e9f0d80..1a78c61 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,3 +10,7 @@ path = "src/sersve.rs" [dependencies] iron = "*" +glob = "*" + +[dependencies.persistent] +git = "https://github.com/iron/persistent" diff --git a/default.json b/default.json index 4f26f46..97825d1 100644 --- a/default.json +++ b/default.json @@ -1,5 +1,5 @@ { "address": "0.0.0.0", - "port": 80, + "port": 8080, "root": "/home/till" } diff --git a/src/sersve.rs b/src/sersve.rs index 1d6e91c..a38a44a 100644 --- a/src/sersve.rs +++ b/src/sersve.rs @@ -196,7 +196,7 @@ fn main() { matches.opt_str("c").map(|conf_file| { let conf_file = File::open(&Path::new(conf_file)); - //conf_file.map_err(|e| panic!("{}", e.desc)); + conf_file.as_ref().map_err::<()>(|e| panic!("{}", e.desc)).unwrap(); let json = match json::from_reader(&mut conf_file.ok().unwrap()) { Ok(Json::Object(o)) => o, _ => panic!("Invalid configuration file. Doesn't contain top-level object.") -- cgit v1.2.3