-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathwasmoon.html
More file actions
28 lines (27 loc) · 896 Bytes
/
wasmoon.html
File metadata and controls
28 lines (27 loc) · 896 Bytes
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
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
<title>lua</title>
<link rel="stylesheet" href="style.css" />
<script type="module" src="/dist/index.js"></script>
</head>
<body>
<script type="wasmoon" config="./fetch.toml">
local function read_file(path)
local file = io.open(path, "rb")
if not file then return nil end
local content = file:read "*a"
file:close()
return content
end
function print_version(event)
print(event.type)
print(_VERSION)
print(read_file('/a.py'))
end
</script>
<button wasmoon-click="print_version">wasmoon version</button>
</body>
</html>