Load configuration in server main
This commit is contained in:
@@ -1,11 +1,17 @@
|
|||||||
use crate::App;
|
use crate::App;
|
||||||
use crate::util::error::{Error, Result};
|
use crate::server::config;
|
||||||
|
use crate::util::error::{Contextualize, Error, Result};
|
||||||
|
|
||||||
pub fn main() -> Result<()> {
|
pub fn main() -> Result<()> {
|
||||||
if let Err(e) = dotenvy::dotenv() {
|
if let Err(e) = dotenvy::dotenv() {
|
||||||
tracing::warn!("Error reading .env: {e}");
|
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...");
|
tracing::info!("Setup complete, launching web server...");
|
||||||
dioxus::launch(App);
|
dioxus::launch(App);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user