import { eventHandler } from "h3"; import { useRuntimeConfig } from "../config.mjs"; export default eventHandler((event) => { const runtimeConfig = useRuntimeConfig(event); const title = runtimeConfig.nitro.openAPI?.meta?.title || "API Reference"; const description = runtimeConfig.nitro.openAPI?.meta?.description || ""; const openAPIEndpoint = runtimeConfig.nitro.openAPI?.route || "./_openapi.json"; const _config = runtimeConfig.nitro.openAPI?.ui?.scalar; const scalarConfig = { ..._config, url: openAPIEndpoint, // @ts-expect-error (missing types?) spec: { url: openAPIEndpoint, ..._config?.spec } }; return ( /* html */ ` ${title}