* [example][m] - start of a simple-example * Empty-Commit * [simple-example][sm] - change from repos.json to datasets.json * [example][m] - changed styling and added octokit * [build][sm] - fix build
12 lines
377 B
TypeScript
12 lines
377 B
TypeScript
import axios from "axios";
|
|
|
|
export default 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);
|
|
}
|
|
return axios.get(url).then((res) => res.data);
|
|
}
|