Skip to content

Commit

Permalink
Merge pull request #48 from reslear/patch-1
Browse files Browse the repository at this point in the history
docs: add nuxt-trpc example
  • Loading branch information
MatsDK authored Aug 2, 2023
2 parents 325e7d9 + 7113f9c commit 34eaa73
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions packages/trpc-playground/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,34 @@ runApp()

</details>

<details>
<summary>trpc-nuxt</summary>

[trpc-nuxt](https://github.com/wobsoriano/trpc-nuxt)

```ts
// server/api/trpc-playground.ts

import { h3Handler } from 'trpc-playground/handlers/h3'
import { appRouter } from '~~/server/trpc/routers'

export default defineLazyEventHandler(async () => {
const setupHandler = await h3Handler({
router: appRouter,
trpcApiEndpoint: '/api/trpc',
playgroundEndpoint: '/api/trpc-playground',
// uncomment this if you're using superjson
// request: {
// superjson: true,
// },
})

return defineEventHandler(setupHandler)
})
```

</details>

tRPC Playground also supports Fastify, Fetch, h3, Koa, and AWS Lambda. You can import them using this format: `trpc-playground/handlers/{framework}`.

## Settings
Expand Down

0 comments on commit 34eaa73

Please sign in to comment.