lib.rs
691 Bytes
extern crate js_sys;
mod api;
mod data;
mod error;
mod client;
mod component;
#[cfg(feature = "console_error_panic_hook")]
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> {
#[cfg(feature = "console_error_panic_hook")]
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()
}