--- /dev/null
+mod utils;
+
+use wasm_bindgen::prelude::*;
+use web_sys::console;
+
+// When the `wee_alloc` feature is enabled, use `wee_alloc` as the global
+// allocator.
+#[cfg(feature = "wee_alloc")]
+#[global_allocator]
+static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT;
+
+#[wasm_bindgen]
+extern {
+ fn alert(s: &str);
+}
+
+#[wasm_bindgen]
+pub fn greet(name: &str) {
+ alert(&format!("Hello, {}!", name));
+ console::log_1(&"Hello bg".into());
+}
+
+#[wasm_bindgen(start)]
+pub fn main() -> Result<(), JsValue> {
+ let window = web_sys::window().expect("no global `window` exists");
+ let document = window.document().expect("should have a document on window");
+ let body = document.body().expect("document should have a body");
+
+ let val = document.create_element("p")?;
+ val.set_inner_html("Hello from Rust!");
+
+ body.append_child(&val)?;
+
+ Ok(())
+}
\ No newline at end of file