mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-25 08:18:57 +01:00
use undici instead :3
This commit is contained in:
parent
d6b075f575
commit
42a3f605d7
1 changed files with 3 additions and 1 deletions
|
@ -33,6 +33,8 @@ function getJson(str) {
|
||||||
|
|
||||||
module.exports = function (app, config, renderTemplate) {
|
module.exports = function (app, config, renderTemplate) {
|
||||||
app.get("/app", async function (req, res) {
|
app.get("/app", async function (req, res) {
|
||||||
|
const { fetch } = await import("undici");
|
||||||
|
|
||||||
let tab = "";
|
let tab = "";
|
||||||
if (req.query.tab) {
|
if (req.query.tab) {
|
||||||
tab = `/?type=${capitalizeFirstLetter(req.query.tab)}`;
|
tab = `/?type=${capitalizeFirstLetter(req.query.tab)}`;
|
||||||
|
@ -47,7 +49,7 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
if (req.query.mobilesearch) {
|
if (req.query.mobilesearch) {
|
||||||
const query = req.query.mobilesearch;
|
const query = req.query.mobilesearch;
|
||||||
const continuation = req.query.continuation || "";
|
const continuation = req.query.continuation || "";
|
||||||
const search = await modules.fetch(
|
const search = await fetch(
|
||||||
`https://inner-api.poketube.fun/api/search?query=${query}&continuation=${continuation}`
|
`https://inner-api.poketube.fun/api/search?query=${query}&continuation=${continuation}`
|
||||||
);
|
);
|
||||||
const text = await search.text();
|
const text = await search.text();
|
||||||
|
|
Loading…
Reference in a new issue