2023-02-03 11:57:43 +00:00
|
|
|
import type { Env } from 'wildebeest/backend/src/types/env'
|
|
|
|
import { WILDEBEEST_VERSION } from 'wildebeest/config/versions'
|
2023-02-15 15:28:51 +00:00
|
|
|
import { cors } from 'wildebeest/backend/src/utils/cors'
|
2023-02-03 11:57:43 +00:00
|
|
|
|
|
|
|
const headers = {
|
2023-02-15 15:28:51 +00:00
|
|
|
...cors(),
|
2023-02-03 11:57:43 +00:00
|
|
|
'content-type': 'application/json',
|
|
|
|
'cache-control': 'max-age=259200, public',
|
|
|
|
}
|
|
|
|
|
|
|
|
export const onRequest: PagesFunction<Env, any> = async () => {
|
|
|
|
return handleRequest()
|
|
|
|
}
|
|
|
|
|
|
|
|
export async function handleRequest(): Promise<Response> {
|
|
|
|
const res = {
|
|
|
|
version: '2.0',
|
2023-02-03 12:11:48 +00:00
|
|
|
software: { name: 'wildebeest', version: WILDEBEEST_VERSION },
|
2023-02-03 11:57:43 +00:00
|
|
|
protocols: ['activitypub'],
|
|
|
|
services: { outbound: [], inbound: [] },
|
|
|
|
usage: { users: {} },
|
|
|
|
openRegistrations: false,
|
|
|
|
metadata: {},
|
|
|
|
}
|
|
|
|
|
|
|
|
return new Response(JSON.stringify(res), { headers })
|
|
|
|
}
|