lobe-chat
1/**
2* This is your entry point to setup the root configuration for tRPC on the server.
3* - `initTRPC` should only be used once per app.
4* - We export only the functionality that we use so we can enforce which base procedures should be used
5*
6* Learn how to create protected base procedures and other things below:
7* @link https://trpc.io/docs/v11/router
8* @link https://trpc.io/docs/v11/procedures
9*/
10import { initTRPC } from '@trpc/server';11import superjson from 'superjson';12
13import type { Context } from '@/server/context';14
15export const trpc = initTRPC.context<Context>().create({16/**17* @link https://trpc.io/docs/v11/error-formatting
18*/
19errorFormatter({ shape }) {20return shape;21},22/**23* @link https://trpc.io/docs/v11/data-transformers
24*/
25transformer: superjson,26});27