diff options
-rw-r--r-- | Cargo.lock | 16 | ||||
-rw-r--r-- | Cargo.toml | 4 | ||||
-rw-r--r-- | default.json | 2 | ||||
-rw-r--r-- | src/sersve.rs | 2 |
4 files changed, 22 insertions, 2 deletions
@@ -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]] @@ -29,6 +31,11 @@ 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" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -94,6 +101,15 @@ dependencies = [ ] [[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" source = "registry+https://github.com/rust-lang/crates.io-index" @@ -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.") |