Mangades/src/util/request.js
Daniel Bulant 7b350219bf use proxy
2021-05-22 13:38:26 +02:00

10 lines
No EOL
345 B
JavaScript

const base = "https://cors-anywhere.danbulant.workers.dev/?https://api.mangadex.org/";
function request(endpoint, query, type = "GET", body) {
return fetch(base + endpoint + (query ? "?" + query : ""), {
method: type,
body: body ? JSON.stringify(body) : undefined
}).then(resp => resp.json());
}
export default request;