First Commit Test
This commit is contained in:
18
server/trpc/context.ts
Normal file
18
server/trpc/context.ts
Normal file
@ -0,0 +1,18 @@
|
||||
import { inferAsyncReturnType } from '@trpc/server'
|
||||
import type { H3Event } from 'h3'
|
||||
|
||||
/**
|
||||
* Creates context for an incoming request
|
||||
* @link https://trpc.io/docs/context
|
||||
*/
|
||||
export function createContext (_event: H3Event) {
|
||||
/**
|
||||
* Add any trpc-request context here. E.g., you could add `prisma` like this (if you've added it via sidebase):
|
||||
* ```ts
|
||||
* return { prisma: _event.context.prisma }
|
||||
* ```
|
||||
*/
|
||||
return {}
|
||||
}
|
||||
|
||||
export type Context = inferAsyncReturnType<typeof createContext>
|
||||
Reference in New Issue
Block a user