refactor: 🚚 Organize code into sub-packages, instead of a single large package

This commit is contained in:
Jesse Wierzbinski 2025-06-15 04:38:20 +02:00
parent 79742f47dc
commit a6d3ebbeef
No known key found for this signature in database
366 changed files with 942 additions and 833 deletions

View file

@ -0,0 +1,47 @@
import { config } from "@versia-server/config";
import { describeRoute } from "hono-openapi";
import { resolver } from "hono-openapi/zod";
import { z } from "zod";
import { apiRoute } from "@/api";
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(),
},
],
});
},
),
);