diff --git a/static/index.html b/static/index.html
index 13606a2..5564d9f 100644
--- a/static/index.html
+++ b/static/index.html
@@ -1,5 +1,13 @@
+
+
+
+
- Test html file.
+ Input org-mode source:
+
+
+
+
diff --git a/static/script.js b/static/script.js
new file mode 100644
index 0000000..06b8c00
--- /dev/null
+++ b/static/script.js
@@ -0,0 +1,35 @@
+let inFlightRequest = null;
+const inputElement = document.querySelector("#org-input");
+const outputElement = document.querySelector("#parse-output");
+
+function abortableFetch(request, options) {
+ const controller = new AbortController();
+ const signal = controller.signal;
+
+ return {
+ abort: () => controller.abort(),
+ ready: fetch(request, { ...options, signal })
+ };
+}
+
+async function renderParseResponse(response) {
+ console.log(response);
+}
+
+inputElement.addEventListener("input", async () => {
+ let orgSource = inputElement.value;
+ if (inFlightRequest != null) {
+ inFlightRequest.abort();
+ inFlightRequest = null;
+ }
+
+ let newRequest = abortableFetch("/parse", {
+ method: "POST",
+ cache: "no-cache",
+ body: orgSource,
+ });
+ inFlightRequest = newRequest;
+
+ let response = await inFlightRequest.ready;
+ renderParseResponse(await response.json());
+});
diff --git a/static/style.css b/static/style.css
new file mode 100644
index 0000000..e69de29