Compare commits
3 commits
master
...
rnewman/bu
Author | SHA1 | Date | |
---|---|---|---|
|
12144e30ea | ||
|
3138c3ed18 | ||
|
f4b8e76ae0 |
7 changed files with 16 additions and 50 deletions
|
@ -18,16 +18,13 @@ rustc_version = "0.1.7"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
chrono = "0.3"
|
chrono = "0.3"
|
||||||
clap = "2.19.3"
|
clap = "2.23"
|
||||||
error-chain = "0.8.1"
|
error-chain = "0.8.1"
|
||||||
nickel = "0.9.0"
|
nickel = "0.9.0"
|
||||||
slog = "1.4.0"
|
time = "0.1"
|
||||||
slog-scope = "0.2.2"
|
|
||||||
slog-term = "1.3.4"
|
|
||||||
time = "0.1.35"
|
|
||||||
|
|
||||||
[dependencies.rusqlite]
|
[dependencies.rusqlite]
|
||||||
version = "0.10.1"
|
version = "0.11"
|
||||||
# System sqlite might be very old.
|
# System sqlite might be very old.
|
||||||
features = ["bundled", "limits"]
|
features = ["bundled", "limits"]
|
||||||
|
|
||||||
|
|
|
@ -5,13 +5,13 @@ workspace = ".."
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
error-chain = "0.8.1"
|
error-chain = "0.8.1"
|
||||||
itertools = "0.5.9"
|
itertools = "0.5"
|
||||||
lazy_static = "0.2.2"
|
lazy_static = "0.2"
|
||||||
ordered-float = "0.4.0"
|
ordered-float = "0.4"
|
||||||
time = "0.1.35"
|
time = "0.1"
|
||||||
|
|
||||||
[dependencies.rusqlite]
|
[dependencies.rusqlite]
|
||||||
version = "0.10.1"
|
version = "0.11"
|
||||||
# System sqlite might be very old.
|
# System sqlite might be very old.
|
||||||
features = ["bundled", "limits"]
|
features = ["bundled", "limits"]
|
||||||
|
|
||||||
|
|
|
@ -12,11 +12,11 @@ readme = "./README.md"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
chrono = "0.3"
|
chrono = "0.3"
|
||||||
itertools = "0.5.9"
|
itertools = "0.5"
|
||||||
num = "0.1.35"
|
num = "0.1"
|
||||||
ordered-float = "0.4.0"
|
ordered-float = "0.4"
|
||||||
pretty = "0.2.0"
|
pretty = "0.2"
|
||||||
uuid = "0.5.0"
|
uuid = "0.5"
|
||||||
|
|
||||||
[build-dependencies]
|
[build-dependencies]
|
||||||
peg = "0.5.1"
|
peg = "0.5"
|
||||||
|
|
|
@ -7,7 +7,7 @@ workspace = ".."
|
||||||
error-chain = "0.8.1"
|
error-chain = "0.8.1"
|
||||||
|
|
||||||
[dependencies.rusqlite]
|
[dependencies.rusqlite]
|
||||||
version = "0.10.1"
|
version = "0.11"
|
||||||
# System sqlite might be very old.
|
# System sqlite might be very old.
|
||||||
features = ["bundled", "limits"]
|
features = ["bundled", "limits"]
|
||||||
|
|
||||||
|
|
|
@ -8,7 +8,7 @@ error-chain = "0.8.1"
|
||||||
ordered-float = "0.4.0"
|
ordered-float = "0.4.0"
|
||||||
|
|
||||||
[dependencies.rusqlite]
|
[dependencies.rusqlite]
|
||||||
version = "0.10.1"
|
version = "0.11"
|
||||||
# System sqlite might be very old.
|
# System sqlite might be very old.
|
||||||
features = ["bundled", "limits"]
|
features = ["bundled", "limits"]
|
||||||
|
|
||||||
|
|
|
@ -11,12 +11,6 @@
|
||||||
#[macro_use]
|
#[macro_use]
|
||||||
extern crate error_chain;
|
extern crate error_chain;
|
||||||
|
|
||||||
#[macro_use]
|
|
||||||
extern crate slog;
|
|
||||||
|
|
||||||
#[macro_use]
|
|
||||||
extern crate slog_scope;
|
|
||||||
|
|
||||||
extern crate rusqlite;
|
extern crate rusqlite;
|
||||||
|
|
||||||
extern crate edn;
|
extern crate edn;
|
||||||
|
@ -38,7 +32,6 @@ pub mod conn;
|
||||||
pub mod query;
|
pub mod query;
|
||||||
|
|
||||||
pub fn get_name() -> String {
|
pub fn get_name() -> String {
|
||||||
info!("Called into mentat library"; "fn" => "get_name");
|
|
||||||
return String::from("mentat");
|
return String::from("mentat");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
24
src/main.rs
24
src/main.rs
|
@ -13,16 +13,9 @@ extern crate clap;
|
||||||
|
|
||||||
use nickel::{Nickel, HttpRouter};
|
use nickel::{Nickel, HttpRouter};
|
||||||
|
|
||||||
#[macro_use]
|
|
||||||
extern crate slog;
|
|
||||||
#[macro_use]
|
|
||||||
extern crate slog_scope;
|
|
||||||
extern crate slog_term;
|
|
||||||
|
|
||||||
extern crate mentat;
|
extern crate mentat;
|
||||||
|
|
||||||
use clap::{App, Arg, SubCommand, AppSettings};
|
use clap::{App, Arg, SubCommand, AppSettings};
|
||||||
use slog::DrainExt;
|
|
||||||
|
|
||||||
use std::u16;
|
use std::u16;
|
||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
@ -59,23 +52,6 @@ fn main() {
|
||||||
matches.value_of("port").unwrap());
|
matches.value_of("port").unwrap());
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set up logging.
|
|
||||||
let log_level = if debug {
|
|
||||||
slog::Level::Debug
|
|
||||||
} else {
|
|
||||||
slog::Level::Warning
|
|
||||||
};
|
|
||||||
let term_logger = slog_term::streamer().build().fuse();
|
|
||||||
let log = slog::Logger::root(slog::LevelFilter::new(term_logger, log_level),
|
|
||||||
o!("version" => env!("CARGO_PKG_VERSION")));
|
|
||||||
slog_scope::set_global_logger(log);
|
|
||||||
|
|
||||||
info!("Serving database"; "database" => matches.value_of("database").unwrap(),
|
|
||||||
"port" => port,
|
|
||||||
"debug mode" => debug);
|
|
||||||
|
|
||||||
error!("Calling a function: {}", mentat::get_name());
|
|
||||||
|
|
||||||
let mut server = Nickel::new();
|
let mut server = Nickel::new();
|
||||||
server.get("/", middleware!("This doesn't do anything yet"));
|
server.get("/", middleware!("This doesn't do anything yet"));
|
||||||
server.listen(("127.0.0.1", port)).expect("Failed to launch server");
|
server.listen(("127.0.0.1", port)).expect("Failed to launch server");
|
||||||
|
|
Loading…
Reference in a new issue