Files
homarr/packages/api/src/open-api.ts
T

22 lines
596 B
TypeScript

import { generateOpenApiDocument } from "trpc-to-openapi";
import { API_KEY_HEADER_NAME } from "@homarr/auth/api-key";
import { appRouter } from "./root";
export const openApiDocument = (base: string) =>
generateOpenApiDocument(appRouter, {
title: "Homarr API documentation",
version: "1.0.0",
baseUrl: base,
docsUrl: "https://homarr.dev",
securitySchemes: {
apikey: {
type: "apiKey",
name: API_KEY_HEADER_NAME,
description: "API key which can be obtained in the Homarr administration dashboard",
in: "header",
},
},
});