reorganise

This commit is contained in:
Alex Janka 2024-02-12 09:54:06 +11:00
parent 83b6d25278
commit e75c62bab5

View file

@ -10,6 +10,22 @@ use rocket::{
#[macro_use] #[macro_use]
extern crate rocket; extern crate rocket;
#[launch]
fn rocket() -> _ {
env_logger::builder()
.format_module_path(false)
.format_timestamp(
if std::env::var("LOG_TIMESTAMP").is_ok_and(|v| v == "false") {
None
} else {
Some(env_logger::TimestampPrecision::Seconds)
},
)
.init();
rocket::build().mount("/", routes![authenticated, deauthenticated, login])
}
struct Secrets { struct Secrets {
client_id: String, client_id: String,
client_secret: String, client_secret: String,
@ -122,22 +138,6 @@ fn login() -> RedirOrStatic {
).into()) ).into())
} }
#[launch]
fn rocket() -> _ {
env_logger::builder()
.format_module_path(false)
.format_timestamp(
if std::env::var("LOG_TIMESTAMP").is_ok_and(|v| v == "false") {
None
} else {
Some(env_logger::TimestampPrecision::Seconds)
},
)
.init();
rocket::build().mount("/", routes![authenticated, deauthenticated, login])
}
enum RedirOrStatic { enum RedirOrStatic {
Redirect(Box<Redirect>), Redirect(Box<Redirect>),
Static(String), Static(String),