server/api/api/v1/frontend/config/index.ts
2025-04-10 19:15:31 +02:00

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);
},
),
);