1
0
Fork 0
mirror of https://github.com/Nutomic/ibis.git synced 2024-12-26 12:11:22 +00:00
ibis/src/main.rs

34 lines
951 B
Rust
Raw Normal View History

2024-01-03 16:06:52 +00:00
#[cfg(feature = "ssr")]
2024-01-03 12:29:25 +00:00
#[tokio::main]
2024-01-09 11:41:44 +00:00
pub async fn main() -> ibis_lib::backend::error::MyResult<()> {
use ibis_lib::backend::config::IbisConfig;
2024-01-03 12:29:25 +00:00
use log::LevelFilter;
2024-02-07 15:54:43 +00:00
if std::env::args().collect::<Vec<_>>().get(1) == Some(&"--print-config".to_string()) {
println!("{}", doku::to_toml::<IbisConfig>());
std::process::exit(0);
}
2024-01-03 12:29:25 +00:00
env_logger::builder()
.filter_level(LevelFilter::Warn)
.filter_module("activitypub_federation", LevelFilter::Debug)
.filter_module("ibis", LevelFilter::Debug)
2024-01-03 12:29:25 +00:00
.init();
2024-02-07 15:54:43 +00:00
2024-02-27 16:49:36 +00:00
let ibis_config = IbisConfig::read()?;
2024-02-07 15:54:43 +00:00
ibis_lib::backend::start(ibis_config).await?;
2024-01-03 12:29:25 +00:00
Ok(())
2024-01-03 16:06:52 +00:00
}
#[cfg(not(feature = "ssr"))]
2024-01-09 11:41:44 +00:00
fn main() {
use ibis_lib::frontend::app::App;
use leptos::{mount_to_body, view};
2024-01-09 11:41:44 +00:00
_ = console_log::init_with_level(log::Level::Debug);
console_error_panic_hook::set_once();
mount_to_body(|| {
view! { <App /> }
2024-01-09 11:41:44 +00:00
});
}