Files
ojrc/auth/src/main.rs
T

31 lines
872 B
Rust
Raw Normal View History

2025-04-06 09:55:29 -04:00
#![forbid(unsafe_code)]
mod common;
#[cfg(feature = "cardlife")]
mod cardlife;
#[rocket::get("/")]
2025-04-02 20:59:52 -04:00
fn index() -> String {
let name = env!("CARGO_PKG_NAME");
let version = env!("CARGO_PKG_VERSION");
let git_version = git_version::git_version!(args = ["--always", "--dirty=+"]);
2025-04-02 20:59:52 -04:00
let authors = env!("CARGO_PKG_AUTHORS");
let license = env!("CARGO_PKG_LICENSE");
let repo = env!("CARGO_PKG_REPOSITORY");
format!("{} {}:{} by [{}]\n{}\n{}", name, version, git_version, authors, license, repo)
}
#[rocket::launch]
2025-05-07 20:23:22 -04:00
async fn rocket() -> _ {
env_logger::init();
2025-04-01 19:38:03 -04:00
let args = common::cli::CliArgs::get();
#[allow(unused_mut)]
2025-04-01 19:38:03 -04:00
let mut builder = rocket::build().mount("/", rocket::routes![index])
2025-05-07 20:23:22 -04:00
.manage(args.preloaded().await);
#[cfg(feature = "cardlife")]
{builder = builder.attach(cardlife::stage());}
builder
}