UNPKG

@zenstackhq/server

Version:

ZenStack server-side adapters

19 lines (18 loc) 589 B
import { FastifyPluginCallback, FastifyReply, FastifyRequest } from 'fastify'; import { AdapterBaseOptions } from '../types'; /** * Fastify plugin options */ export interface PluginOptions extends AdapterBaseOptions { /** * Url prefix, e.g.: /api */ prefix: string; /** * Callback for getting a PrismaClient for the given request */ getPrisma: (request: FastifyRequest, reply: FastifyReply) => unknown | Promise<unknown>; } declare const plugin: FastifyPluginCallback<PluginOptions>; export default plugin; export { plugin as ZenStackFastifyPlugin };