From b9dfd552a62a46449532d49adc0773589076c808 Mon Sep 17 00:00:00 2001 From: Uri Shaked Date: Thu, 21 Nov 2019 19:40:02 +0200 Subject: feat: add blink demo --- demo/src/compile.ts | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 demo/src/compile.ts (limited to 'demo/src/compile.ts') 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; +} -- cgit v1.2.3