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

use std::panic;

use crate::component::*;
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 md = markdown::new().await;
    let comp = upload::new().await;

    let page = Component::from(builder! {
        <div>
            {comp}
            {md}
        </div>
    });
    page.build()?.run()
}