mirror of
https://github.com/danbulant/Mangades
synced 2026-07-05 11:00:40 +00:00
better formatting
This commit is contained in:
parent
0d48ca6a1f
commit
7e2d9eb658
2 changed files with 17 additions and 11 deletions
|
|
@ -1,15 +1,9 @@
|
||||||
<script>
|
<script>
|
||||||
var name = "overlord";
|
import request from "./request";
|
||||||
const base = "https://api.mangadex.org/";
|
var name = "";
|
||||||
|
|
||||||
function request(endpoint, query, type = "GET", body) {
|
|
||||||
return fetch(base + endpoint + "?" + query, {
|
|
||||||
method: type,
|
|
||||||
body: body ? JSON.stringify(body) : undefined
|
|
||||||
}).then(resp => resp.json());
|
|
||||||
}
|
|
||||||
|
|
||||||
var result = request("manga", "title=" + name + "&contentRating[]=safe&contentRating[]=suggestive");
|
var result = request("manga", "title=" + name + "&contentRating[]=safe&contentRating[]=suggestive");
|
||||||
|
$: result = request("manga", "title=" + name + "&contentRating[]=safe&contentRating[]=suggestive");
|
||||||
result.then(console.log);
|
result.then(console.log);
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
@ -38,8 +32,10 @@
|
||||||
<style>
|
<style>
|
||||||
main
|
main
|
||||||
{
|
{
|
||||||
max-width: 720px;
|
max-width: 450px;
|
||||||
margin: auto;
|
margin: auto;
|
||||||
}
|
}
|
||||||
|
input {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
10
src/request.js
Normal file
10
src/request.js
Normal file
|
|
@ -0,0 +1,10 @@
|
||||||
|
const base = "https://api.mangadex.org/";
|
||||||
|
|
||||||
|
function request(endpoint, query, type = "GET", body) {
|
||||||
|
return fetch(base + endpoint + "?" + query, {
|
||||||
|
method: type,
|
||||||
|
body: body ? JSON.stringify(body) : undefined
|
||||||
|
}).then(resp => resp.json());
|
||||||
|
}
|
||||||
|
|
||||||
|
export default request;
|
||||||
Loading…
Reference in a new issue