mirror of
https://git.sr.ht/~cadence/bibliogram
synced 2024-11-22 08:07:30 +00:00
Fix instances API and user import script
This commit is contained in:
parent
f3014e3fc6
commit
a903647eb1
@ -10,7 +10,7 @@ const {request} = require("../src/lib/utils/request")
|
|||||||
process.exit(1)
|
process.exit(1)
|
||||||
}
|
}
|
||||||
if (target.match(/^https?:\/\//)) {
|
if (target.match(/^https?:\/\//)) {
|
||||||
var usersString = await request(target).then(res => res.text())
|
var usersString = await request(target).text()
|
||||||
} else {
|
} else {
|
||||||
var usersString = await fs.readFile(target, {encoding: "utf8"})
|
var usersString = await fs.readFile(target, {encoding: "utf8"})
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ module.exports = [
|
|||||||
{
|
{
|
||||||
route: "/api/instances", methods: ["GET"], code: () => {
|
route: "/api/instances", methods: ["GET"], code: () => {
|
||||||
return instanceListCache.getOrFetch("instances", () => {
|
return instanceListCache.getOrFetch("instances", () => {
|
||||||
return request(constants.resources.instances_wiki_raw).then(res => res.text()).then(text => {
|
return request(constants.resources.instances_wiki_raw).text().then(text => {
|
||||||
const result = (() => {
|
const result = (() => {
|
||||||
const instances = []
|
const instances = []
|
||||||
const parser = new Parser(text)
|
const parser = new Parser(text)
|
||||||
|
Loading…
Reference in New Issue
Block a user