1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
#![feature(proc_macro_hygiene)] extern crate bytes; extern crate futures; extern crate getopts; extern crate lazy_static; extern crate maud; extern crate mime; extern crate mime_guess; extern crate postgres; extern crate serde; extern crate actix_session; extern crate actix_service; extern crate actix_web; extern crate slog; extern crate slog_json; extern crate slog_term; extern crate slog_async; #[macro_use] extern crate rust_embed; pub(crate) mod config { pub(crate) mod args; pub(crate) mod cfg; pub(crate) mod project; } pub(crate) mod controllers { pub(crate) mod error; pub(crate) mod static_file; pub(crate) mod utils; pub(crate) mod home; pub(crate) mod projects; } pub(crate) mod db { pub(crate) mod conn; } pub(crate) mod models { pub(crate) mod field_type; } pub(crate) mod server { pub(crate) mod ctx; pub(crate) mod start; pub(crate) mod assets; } pub(crate) mod templates { pub(crate) mod components { pub(crate) mod header; pub(crate) mod header_noauth; pub(crate) mod navbar; pub(crate) mod page; } pub(crate) mod error; pub(crate) mod index; pub(crate) mod projects { pub(crate) mod list; pub(crate) mod detail; } pub(crate) mod testbed; } use crate::config::cfg::AppConfig; #[cfg(debug_assertions)] fn is_debug() -> bool { true } #[cfg(not(debug_assertions))] fn is_debug() -> bool { false } pub fn go() -> std::io::Result<()> { let _e = "String".parse::<models::field_type::FieldType>(); let matches = config::args::get_args().expect("Cannot parse args"); let cfg = AppConfig::new(matches.0, matches.1, matches.2 || is_debug()); server::start::start(cfg) }