mirror of
https://github.com/versia-pub/server.git
synced 2025-12-06 08:28:19 +01:00
30 lines
871 B
TypeScript
30 lines
871 B
TypeScript
import { describeRoute } from "hono-openapi";
|
|
import { resolver } from "hono-openapi/zod";
|
|
import { z } from "zod";
|
|
import { apiRoute } from "@/api";
|
|
import { config } from "~/config.ts";
|
|
|
|
export default apiRoute((app) =>
|
|
app.get(
|
|
"/api/v1/frontend/config",
|
|
describeRoute({
|
|
summary: "Get frontend config",
|
|
responses: {
|
|
200: {
|
|
description: "Frontend config",
|
|
content: {
|
|
"application/json": {
|
|
schema: resolver(
|
|
z.record(z.string(), z.any()).default({}),
|
|
),
|
|
},
|
|
},
|
|
},
|
|
},
|
|
}),
|
|
(context) => {
|
|
return context.json(config.frontend.settings, 200);
|
|
},
|
|
),
|
|
);
|