mirror of
https://github.com/movie-web/backend.git
synced 2025-09-13 18:13:26 +00:00
add basic repo setup, with user creation
This commit is contained in:
32
src/services/router.ts
Normal file
32
src/services/router.ts
Normal file
@@ -0,0 +1,32 @@
|
||||
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);
|
||||
},
|
||||
};
|
||||
}
|
Reference in New Issue
Block a user