mirror of
https://github.com/movie-web/backend.git
synced 2025-09-13 14:33:27 +00:00
33 lines
691 B
TypeScript
33 lines
691 B
TypeScript
import {
|
|
FastifyBaseLogger,
|
|
FastifyInstance,
|
|
FastifyPluginAsync,
|
|
RawReplyDefaultExpression,
|
|
RawRequestDefaultExpression,
|
|
RawServerBase,
|
|
} from 'fastify';
|
|
import { ZodTypeProvider } from 'fastify-type-provider-zod';
|
|
|
|
export type Instance = FastifyInstance<
|
|
RawServerBase,
|
|
RawRequestDefaultExpression<RawServerBase>,
|
|
RawReplyDefaultExpression<RawServerBase>,
|
|
FastifyBaseLogger,
|
|
ZodTypeProvider
|
|
>;
|
|
export type RegisterPlugin = FastifyPluginAsync<
|
|
Record<never, never>,
|
|
RawServerBase,
|
|
ZodTypeProvider
|
|
>;
|
|
|
|
export function makeRouter(cb: (app: Instance) => void): {
|
|
register: RegisterPlugin;
|
|
} {
|
|
return {
|
|
register: async (app) => {
|
|
cb(app);
|
|
},
|
|
};
|
|
}
|