Compare commits
2 Commits
353288bc05
...
f81ae354bd
| Author | SHA1 | Date | |
|---|---|---|---|
|
f81ae354bd
|
|||
|
dfa75b97ca
|
@@ -23,7 +23,12 @@ fn main() {
|
||||
}
|
||||
|
||||
#[cfg(feature = "server")]
|
||||
fn main() {
|
||||
fn main() -> std::process::ExitCode {
|
||||
tracing_setup();
|
||||
server::main()
|
||||
|
||||
if let Err(e) = server::main() {
|
||||
tracing::error!("Server main failed:\n{e}");
|
||||
}
|
||||
|
||||
std::process::ExitCode::FAILURE
|
||||
}
|
||||
|
||||
@@ -1,9 +1,19 @@
|
||||
use crate::App;
|
||||
use crate::util::error::{Contextualize, Error, Result};
|
||||
use crate::server::config;
|
||||
|
||||
pub fn main() {
|
||||
pub fn main() -> Result<()> {
|
||||
if let Err(e) = dotenvy::dotenv() {
|
||||
tracing::warn!("Error reading .env: {e}");
|
||||
}
|
||||
|
||||
tracing::debug!("Loading configuration...");
|
||||
let config = config::load_config()
|
||||
.map_err(|e| Error::message_here(e.to_string()))
|
||||
.err_context("Failed to load config")?;
|
||||
|
||||
tracing::info!("Setup complete, launching web server...");
|
||||
dioxus::launch(App);
|
||||
|
||||
Err(Error::message_here("Web server exited"))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user