Skip to content

createPanelHandler

function createPanelHandler(options): PanelHandler;

Defined in: src/server/panel.ts:101

Build the panel handler.

Parameter Type
options PanelOptions

PanelHandler

import { createPanelHandler, resolveUiDir } from "@xtandard/kit/server";
const panel = createPanelHandler({
basePath: options.basePath,
title: options.title ?? "@xtandard/webhooks",
globalName: "__WEBHOOKS_CONFIG__",
uiDir: options.uiDir ?? resolveUiDir(import.meta.url),
api: (request, path) => handleApiRequest(request, path, ctx),
openapi: () => buildOpenApiDocument({ basePath, title }),
tasks: [dispatcherTask],
});
Bun.serve({ fetch: panel.fetch });