context.ts 265 B

12345678
  1. import { FetchCreateContextFnOptions } from '@trpc/server/adapters/fetch';
  2. export function createContext({
  3. req,
  4. resHeaders,
  5. }: FetchCreateContextFnOptions) {
  6. // const user = { name: req.headers.get('username') ?? 'anonymous' };
  7. return { req, resHeaders };
  8. }