[basic-example][m] - remove middleware

This commit is contained in:
Luccas Mateus de Medeiros Gomes
2023-04-26 09:15:55 -03:00
parent 5a70118545
commit 8038662160
6 changed files with 7 additions and 28 deletions

View File

@@ -0,0 +1,5 @@
export default async function loadData(url: string) {
const response = await fetch(url)
const data = await response.text()
return data
}

View File

@@ -1,11 +0,0 @@
export default async function loadUrlProxied(url: string) {
// HACK: duplicate of Excel code - maybe refactor
// if url is external may have CORS issue so we proxy it ...
if (url.startsWith("http")) {
const PROXY_URL = "/api/proxy";
url = PROXY_URL + "?url=" + encodeURIComponent(url);
}
const response = await fetch(url)
const data = await response.text()
return data
}