lib.rs 483 Bytes
mod api;
mod data;
mod error;
mod client;
mod component;

use std::panic;

use crate::component::markdown;
use log::Level;
use mogwai::prelude::*;
use wasm_bindgen::prelude::*;

#[wasm_bindgen(start)]
pub async fn main() -> Result<(), JsValue> {
    panic::set_hook(Box::new(console_error_panic_hook::hook));
    console_log::init_with_level(Level::Trace).unwrap();

    let comp = markdown::new().await;

    let page = Component::from(builder! {{comp}});
    page.build()?.run()
}