From 26aedb331aaff69c4ccf2f87ec6d8e5ca0c185d4 Mon Sep 17 00:00:00 2001 From: Ashley Date: Sat, 16 Sep 2023 17:03:11 +0000 Subject: [PATCH] use undici instead :3 --- src/libpoketube/init/pages-api.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libpoketube/init/pages-api.js b/src/libpoketube/init/pages-api.js index b5cb3927..c9335303 100644 --- a/src/libpoketube/init/pages-api.js +++ b/src/libpoketube/init/pages-api.js @@ -140,11 +140,12 @@ module.exports = function (app, config, renderTemplate) { }); app.get("/api/instances.json", async (req, res) => { + const { fetch } = await import("undici"); + try { const url = `https://codeberg.org/Ashley/poketube/raw/branch/main/instances.json`; - let f = await modules - .fetch(url) + let f = await fetch(url) .then((res) => res.text()) .then((json) => JSON.parse(json));