aboutsummaryrefslogtreecommitdiff
path: root/demo/src/compile.ts
diff options
context:
space:
mode:
authorUri Shaked2019-11-21 19:40:02 +0200
committerUri Shaked2019-11-21 20:05:23 +0200
commitb9dfd552a62a46449532d49adc0773589076c808 (patch)
tree8eb1ec1f49e7b8e097a51ee6bf266a609eafac43 /demo/src/compile.ts
parentchore: release 0.2.0 (diff)
downloadavr8js-b9dfd552a62a46449532d49adc0773589076c808.tar.gz
avr8js-b9dfd552a62a46449532d49adc0773589076c808.tar.bz2
avr8js-b9dfd552a62a46449532d49adc0773589076c808.zip
feat: add blink demo
Diffstat (limited to '')
-rw-r--r--demo/src/compile.ts20
1 files changed, 20 insertions, 0 deletions
diff --git a/demo/src/compile.ts b/demo/src/compile.ts
new file mode 100644
index 0000000..4fca6c6
--- /dev/null
+++ b/demo/src/compile.ts
@@ -0,0 +1,20 @@
+const url = 'https://wokwi-hexi-73miufol2q-uc.a.run.app';
+
+export interface IHexiResult {
+ stdout: string;
+ stderr: string;
+ hex: string;
+}
+
+export async function buildHex(source: string) {
+ const resp = await fetch(url + '/build', {
+ method: 'POST',
+ mode: 'cors',
+ cache: 'no-cache',
+ headers: {
+ 'Content-Type': 'application/json'
+ },
+ body: JSON.stringify({ sketch: source })
+ });
+ return (await resp.json()) as IHexiResult;
+}