LordXido commited on
Commit
5cbcb7d
·
verified ·
1 Parent(s): 6bd284d

Create web/app.js

Browse files
Files changed (1) hide show
  1. web/app.js +12 -0
web/app.js ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ async function runProgram() {
2
+ const program = document.getElementById("program").value;
3
+
4
+ const response = await fetch("/run", {
5
+ method: "POST",
6
+ headers: { "Content-Type": "application/json" },
7
+ body: JSON.stringify({ program_hex: program })
8
+ });
9
+
10
+ const data = await response.json();
11
+ document.getElementById("output").textContent = data.stdout || data.stderr;
12
+ }