mirror of
https://git.sr.ht/~cadence/bibliogram
synced 2024-11-22 16:17:29 +00:00
Add nodeinfo
This commit is contained in:
parent
cf8fd6b86b
commit
7b5db91efc
@ -10,9 +10,59 @@ function reply(statusCode, content) {
|
||||
}
|
||||
|
||||
module.exports = [
|
||||
{route: `/api/user/(${constants.external.username_regex})`, methods: ["GET"], code: async ({fill}) => {
|
||||
{
|
||||
route: `/api/user/(${constants.external.username_regex})`, methods: ["GET"], code: async ({fill}) => {
|
||||
const user = await fetchUser(fill[0])
|
||||
const data = user.export()
|
||||
return reply(200, data)
|
||||
}}
|
||||
}
|
||||
},
|
||||
{
|
||||
route: "/.well-known/nodeinfo", methods: ["GET"], code: async ({fill}) => {
|
||||
return reply(200, {
|
||||
link: [
|
||||
{
|
||||
rel: "http://nodeinfo.diaspora.software/ns/schema/2.0",
|
||||
href: `${constants.website_origin}/api/stats/2.0`
|
||||
}
|
||||
]
|
||||
})
|
||||
}
|
||||
},
|
||||
{
|
||||
route: "/api/stats/2.0", methods: ["GET"], code: async ({fill}) => {
|
||||
return reply(200, {
|
||||
version: "2.0",
|
||||
software: {
|
||||
name: "bibliogram",
|
||||
version: "1.0.0"
|
||||
},
|
||||
protocols: [],
|
||||
services: {
|
||||
inbound: [
|
||||
"instagram"
|
||||
],
|
||||
outbound: []
|
||||
},
|
||||
openRegistrations: false,
|
||||
usage: {
|
||||
users: {
|
||||
total: 0,
|
||||
activeHalfyear: 0,
|
||||
activeMonth: 0
|
||||
}
|
||||
},
|
||||
metadata: {
|
||||
bibliogram: {
|
||||
version: "1.0",
|
||||
features: [
|
||||
"PAGE_PROFILE",
|
||||
"PAGE_POST",
|
||||
"API_STATS"
|
||||
]
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user