-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
34 lines (27 loc) · 894 Bytes
/
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
<!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">
<title>A Title</title>
</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>