/
index.html
40 lines (33 loc) · 1.13 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<meta name="description" content="" />
<link rel="icon" type="image/png" href="/public/favicon.png" />
<!--<link rel="stylesheet" type="text/css" href="/style.css">-->
<title>Counter example</title>
<!-- Because of Edge, see https://github.com/samthor/fast-text-encoding -->
<script type="text/javascript" src="/public/text-polyfill.min.js"></script>
</head>
<body>
<section id="app"></section>
<script src="/pkg/package.js"></script>
<script>
// the `wasm_bindgen` global is set to the exports of the Rust module
const { render } = wasm_bindgen;
// we'll defer our execution until the wasm is ready to go
function run() {
render();
}
// here we tell bindgen the path to the wasm file so it can run
// initialization and return to us a promise when it's done
wasm_bindgen("/pkg/package_bg.wasm")
.then(run)
.catch(console.error);
</script>
</body>
</html>