diff options
| author | Uri Shaked | 2019-11-21 19:40:02 +0200 |
|---|---|---|
| committer | Uri Shaked | 2019-11-21 20:05:23 +0200 |
| commit | b9dfd552a62a46449532d49adc0773589076c808 (patch) | |
| tree | 8eb1ec1f49e7b8e097a51ee6bf266a609eafac43 /demo/src/compile.ts | |
| parent | chore: release 0.2.0 (diff) | |
| download | avr8js-b9dfd552a62a46449532d49adc0773589076c808.tar.gz avr8js-b9dfd552a62a46449532d49adc0773589076c808.tar.bz2 avr8js-b9dfd552a62a46449532d49adc0773589076c808.zip | |
feat: add blink demo
Diffstat (limited to 'demo/src/compile.ts')
| -rw-r--r-- | demo/src/compile.ts | 20 |
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; +} |
