mirror of
https://github.com/danbulant/Mangades
synced 2026-06-19 14:21:23 +00:00
10 lines
No EOL
345 B
JavaScript
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; |