mirror of
https://github.com/ArthurDanjou/website.git
synced 2026-01-23 16:30:38 +01:00
first commit
This commit is contained in:
20
src/plugins/trpc.ts
Normal file
20
src/plugins/trpc.ts
Normal 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,
|
||||
},
|
||||
}
|
||||
})
|
||||
Reference in New Issue
Block a user