first commit

This commit is contained in:
2023-05-02 19:11:53 +02:00
commit a6f058452d
21 changed files with 9977 additions and 0 deletions

20
src/plugins/trpc.ts Normal file
View File

@@ -0,0 +1,20 @@
import SuperJSON from 'superjson'
import { createTRPCNuxtClient, httpBatchLink } from 'trpc-nuxt/client'
import type { AppRouter } from '~/server/trpc/routers'
export default defineNuxtPlugin(() => {
const trpc = createTRPCNuxtClient<AppRouter>({
transformer: SuperJSON,
links: [
httpBatchLink({
url: '/api/trpc',
}),
],
})
return {
provide: {
trpc,
},
}
})