server/packages/api/routes/well-known/nodeinfo/index.ts
Jesse Wierzbinski 1f03017327
Some checks failed
Mirror to Codeberg / Mirror (push) Failing after 0s
Test Publish / build (client) (push) Failing after 0s
Test Publish / build (sdk) (push) Failing after 0s
refactor: 🚚 Rename @versia/kit to @versia-server/kit
2025-06-15 23:50:34 +02:00

48 lines
1.5 KiB
TypeScript

import { config } from "@versia-server/config";
import { apiRoute } from "@versia-server/kit/api";
import { describeRoute } from "hono-openapi";
import { resolver } from "hono-openapi/zod";
import { z } from "zod";
export default apiRoute((app) =>
app.get(
"/.well-known/nodeinfo",
describeRoute({
summary: "Well-known nodeinfo",
tags: ["Federation"],
responses: {
200: {
description: "Nodeinfo links",
content: {
"application/json": {
schema: resolver(
z.object({
links: z.array(
z.object({
rel: z.string(),
href: z.string(),
}),
),
}),
),
},
},
},
},
}),
(context) => {
return context.json({
links: [
{
rel: "http://nodeinfo.diaspora.software/ns/schema/2.0",
href: new URL(
"/.well-known/nodeinfo/2.0",
config.http.base_url,
).toString(),
},
],
});
},
),
);