From a46e8b37122ffecaece8b764a46f577b21518ccc Mon Sep 17 00:00:00 2001 From: reslear Date: Fri, 28 Jul 2023 19:16:08 +0200 Subject: [PATCH 1/4] Update README.md closes https://github.com/sachinraja/trpc-playground/issues/47 --- packages/trpc-playground/README.md | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/packages/trpc-playground/README.md b/packages/trpc-playground/README.md index dd7d71c..6b4cf17 100644 --- a/packages/trpc-playground/README.md +++ b/packages/trpc-playground/README.md @@ -94,6 +94,31 @@ runApp() + +
+trpc-nuxt + +[trpc-nuxt](https://github.com/wobsoriano/trpc-nuxt) + +```ts +// server/api/trpc-playground.ts + +import { appRouter } from '~~/server/trpc/routers' +import { h3Handler } from 'trpc-playground/handlers/h3' + +export default defineLazyEventHandler(async () => { + const setupHandler = await h3Handler({ + router: appRouter, + trpcApiEndpoint: '/api/trpc', + playgroundEndpoint: '/api/trpc-playground', + }) + + return defineEventHandler(setupHandler) +}) +``` + +
+ tRPC Playground also supports Fastify, Fetch, h3, Koa, and AWS Lambda. You can import them using this format: `trpc-playground/handlers/{framework}`. ## Settings From 9edc8a7f7653951bd1a5fb61ea5173f90753342a Mon Sep 17 00:00:00 2001 From: MatsDK <67562518+MatsDK@users.noreply.github.com> Date: Wed, 2 Aug 2023 22:49:52 +0200 Subject: [PATCH 2/4] Add superjson comment --- packages/trpc-playground/README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/packages/trpc-playground/README.md b/packages/trpc-playground/README.md index 6b4cf17..1ad3517 100644 --- a/packages/trpc-playground/README.md +++ b/packages/trpc-playground/README.md @@ -111,6 +111,10 @@ export default defineLazyEventHandler(async () => { router: appRouter, trpcApiEndpoint: '/api/trpc', playgroundEndpoint: '/api/trpc-playground', + // uncomment this if you're using superjson + // request: { + // superjson: true, + // }, }) return defineEventHandler(setupHandler) From c0cd727661cc6a1ec58bf7a0128ef8c5ca65cdab Mon Sep 17 00:00:00 2001 From: MatsDK <67562518+MatsDK@users.noreply.github.com> Date: Wed, 2 Aug 2023 22:53:16 +0200 Subject: [PATCH 3/4] fix lint error --- packages/trpc-playground/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/trpc-playground/README.md b/packages/trpc-playground/README.md index 1ad3517..38dbd7c 100644 --- a/packages/trpc-playground/README.md +++ b/packages/trpc-playground/README.md @@ -103,8 +103,8 @@ runApp() ```ts // server/api/trpc-playground.ts -import { appRouter } from '~~/server/trpc/routers' import { h3Handler } from 'trpc-playground/handlers/h3' +import { appRouter } from '~~/server/trpc/routers' export default defineLazyEventHandler(async () => { const setupHandler = await h3Handler({ From 7113f9c5c25fa753fc0f69ed9cd1b5df55d476df Mon Sep 17 00:00:00 2001 From: MatsDK <67562518+MatsDK@users.noreply.github.com> Date: Wed, 2 Aug 2023 22:56:39 +0200 Subject: [PATCH 4/4] remove extra line --- packages/trpc-playground/README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/packages/trpc-playground/README.md b/packages/trpc-playground/README.md index 38dbd7c..08278b7 100644 --- a/packages/trpc-playground/README.md +++ b/packages/trpc-playground/README.md @@ -94,7 +94,6 @@ runApp() -
trpc-nuxt