initial commit
This commit is contained in:
17
packages/api/src/routers/index.ts
Normal file
17
packages/api/src/routers/index.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import type { RouterClient } from "@orpc/server";
|
||||
|
||||
import { protectedProcedure, publicProcedure } from "../index";
|
||||
|
||||
export const appRouter = {
|
||||
healthCheck: publicProcedure.handler(() => {
|
||||
return "OK";
|
||||
}),
|
||||
privateData: protectedProcedure.handler(({ context }) => {
|
||||
return {
|
||||
message: "This is private",
|
||||
user: context.session?.user,
|
||||
};
|
||||
}),
|
||||
};
|
||||
export type AppRouter = typeof appRouter;
|
||||
export type AppRouterClient = RouterClient<typeof appRouter>;
|
||||
Reference in New Issue
Block a user