aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTill Hoeppner2014-11-26 23:27:57 +0100
committerTill Hoeppner2014-11-26 23:27:57 +0100
commitca5a2b6e222ff556b8bcab4f20ec9fecc4e81bc9 (patch)
tree7f5fbdf0ba055bf066902fcef27c2a7ccad53f6f
parentae2651ee86f604757b5474dee8b343d28f0fce75 (diff)
downloadsersve-ca5a2b6e222ff556b8bcab4f20ec9fecc4e81bc9.tar.gz
sersve-ca5a2b6e222ff556b8bcab4f20ec9fecc4e81bc9.tar.xz
sersve-ca5a2b6e222ff556b8bcab4f20ec9fecc4e81bc9.zip
Change defaults, errors and build setup
-rw-r--r--Cargo.lock16
-rw-r--r--Cargo.toml4
-rw-r--r--default.json2
-rw-r--r--src/sersve.rs2
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]]
@@ -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"
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.")