Skip to content

Instantly share code, notes, and snippets.

View Y3K-dev's full-sized avatar
🎯
ඞ stu-dying

Y3K Y3K-dev

🎯
ඞ stu-dying
View GitHub Profile
@cj
cj / [trpc].ts
Created August 23, 2022 03:05
Astro trpc client handler
import { appRouter } from 'server'
import type { APIContext } from 'astro'
import { resolveHTTPResponse } from '@trpc/server'
import type { HTTPHeaders } from '@trpc/client'
/**
* Handles trpc query client requests.
*
* @param {APIContext} - Astro API Context
* @returns {Promise<Response>} - trpc response