reorganise
This commit is contained in:
parent
83b6d25278
commit
e75c62bab5
32
src/main.rs
32
src/main.rs
|
@ -10,6 +10,22 @@ use rocket::{
|
|||
#[macro_use]
|
||||
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 {
|
||||
client_id: String,
|
||||
client_secret: String,
|
||||
|
@ -122,22 +138,6 @@ fn login() -> RedirOrStatic {
|
|||
).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 {
|
||||
Redirect(Box<Redirect>),
|
||||
Static(String),
|
||||
|
|
Loading…
Reference in a new issue