-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Description
I have tried running the project in my local machine, running cors-proxy before running npm run serve. It did come to select the repository and tried to clone it, but to no luck.
src/CorsProxy.js
export default class CorsProxy {
static URL = "http://127.0.0.1:9999";
static DEV_URL = "http://127.0.0.1:9999";
static get(url, headers) {
if (window.isElectron) {
return fetch(url, {
headers: headers,
});
}
if (url.startsWith("https://")) {
url = url.replace("https://", "");
}
return fetch(CorsProxy.getProxyUrl() + "/" + url, {
headers: headers,
});
}
static getProxyUrl() {
if (window.isElectron) {
return undefined;
}
if (process.env.NODE_ENV === "development") {
return CorsProxy.DEV_URL;
}
return CorsProxy.URL;
}
static isAvailable() {
if (window.isElectron || process.env.NODE_ENV !== "development") {
return new Promise((resolve) => resolve(true));
}
return this.get("https://github.com/")
.then(() => true)
.catch(() => false);
}
}Metadata
Metadata
Assignees
Labels
No labels