This commit is contained in:
Adrian Charkiewicz 2023-02-15 22:29:14 +01:00
parent 530c364be8
commit ef9eddfcf7
1 changed files with 22 additions and 0 deletions

22
index.html Normal file
View File

@ -0,0 +1,22 @@
<html lang="en">
<head>
<script>
async function parse(){
document.getElementById("result").innerHTML = "Dodawanie pliku..."
var data = new FormData()
data.append('file', document.getElementById("docpicker").files[0])
document.getElementById("result").innerHTML = "Proszę chwilę poczekać, zaraz wypluje info o fakturze :)"
resp = await fetch('http://34.207.94.103:80/invoice', {method: "POST", body: data})
document.getElementById("result").innerHTML = "Info"
data = await resp.json()
var result = JSON.stringify(data)
document.getElementById("result").innerHTML = result
}
</script>
<title>Chmura</title>
</head>
<body>
<input type="file" id="docpicker" accept=".pdf" onchange="parse()" />
<p id="result"></p>
</body>
</html>