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<()> {
|
2024-02-08 11:20:01 +00:00
|
|
|
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)
|
2024-03-12 09:51:32 +00:00
|
|
|
.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;
|
2024-03-05 15:38:07 +00:00
|
|
|
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/> }
|
|
|
|
});
|
|
|
|
}
|