aboutsummaryrefslogtreecommitdiffstats
path: root/packages/web/server/api/client.ts
blob: 7008e10dfcefc296c8d9dc7fdba3fe557ce0d8b0 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
import { appRouter } from "./routers/_app";
import { getServerAuthSession } from "@/server/auth";
import { Context, createCallerFactory } from "./trpc";

export const createContext = async (): Promise<Context> => {
  const session = await getServerAuthSession();
  return {
    session,
  };
};

const createCaller = createCallerFactory(appRouter);

export const api = createCaller(createContext);