Files
trpc-nuxt/playground/server/trpc/context.ts
wobsoriano 68003e9c3e update docs
2022-11-24 12:51:28 -08:00

19 lines
481 B
TypeScript

/* eslint-disable @typescript-eslint/no-unused-vars */
import type { inferAsyncReturnType } from '@trpc/server'
import type { H3Event } from 'h3'
export type Context = inferAsyncReturnType<typeof createContext>
/**
* Creates context for an incoming request
* @link https://trpc.io/docs/context
*/
export function createContext (
event: H3Event
) {
// for API-response caching see https://trpc.io/docs/caching
console.log('cookies', parseCookies(event))
return {}
}