server/packages/plugin-kit/example.ts
Jesse Wierzbinski 58342e86e1
refactor(api): ♻️ Move from @hono/zod-openapi to hono-openapi
hono-openapi is easier to work with and generates better OpenAPI definitions
2025-03-29 03:30:06 +01:00

17 lines
326 B
TypeScript

import { z } from "zod";
import { Hooks } from "./hooks.ts";
import { Plugin } from "./plugin.ts";
const myPlugin = new Plugin(
z.object({
apiKey: z.string(),
}),
);
myPlugin.registerHandler(Hooks.Response, (req) => {
console.info("Request received:", req);
return req;
});
export default myPlugin;