// Back - An extremely simple git issue tracking system. Inspired by tvix's // panettone // // Copyright (C) 2024 Benedikt Peetz // SPDX-License-Identifier: AGPL-3.0-or-later // // This file is part of Back. // // You should have received a copy of the License along with this program. // If not, see . use std::process; use clap::Parser; use config::BackConfig; use rocket::routes; use crate::web::{closed, open, show_issue, styles}; mod cli; pub mod config; mod error; pub mod git_bug; mod web; fn main() -> Result<(), String> { if let Err(err) = rocket_main() { eprintln!("Error {err}"); process::exit(1); } else { Ok(()) } } #[rocket::main] async fn rocket_main() -> Result<(), error::Error> { let args = cli::Cli::parse(); let config = BackConfig::from_config_file(&args.config_file)?; rocket::build() .mount("/", routes![open, closed, show_issue, styles]) .manage(config) .ignite() .await .expect("This error should only happen on a miss-configuration.") .launch() .await?; Ok(()) }