mirror of
https://codeberg.org/ashley/poke.git
synced 2024-11-10 12:38:26 +01:00
use undici instead :3
This commit is contained in:
parent
68b27e5657
commit
26aedb331a
1 changed files with 3 additions and 2 deletions
|
@ -140,11 +140,12 @@ module.exports = function (app, config, renderTemplate) {
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get("/api/instances.json", async (req, res) => {
|
app.get("/api/instances.json", async (req, res) => {
|
||||||
|
const { fetch } = await import("undici");
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const url = `https://codeberg.org/Ashley/poketube/raw/branch/main/instances.json`;
|
const url = `https://codeberg.org/Ashley/poketube/raw/branch/main/instances.json`;
|
||||||
|
|
||||||
let f = await modules
|
let f = await fetch(url)
|
||||||
.fetch(url)
|
|
||||||
.then((res) => res.text())
|
.then((res) => res.text())
|
||||||
.then((json) => JSON.parse(json));
|
.then((json) => JSON.parse(json));
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue