mirror of
https://github.com/ArthurDanjou/trpc-nuxt.git
synced 2026-01-14 20:19:33 +01:00
make trpc-nuxt flexible by exporting server and client functions instead of nuxt modules
This commit is contained in:
12
playground/server/api/trpc/[trpc].ts
Normal file
12
playground/server/api/trpc/[trpc].ts
Normal file
@@ -0,0 +1,12 @@
|
||||
import { createNuxtApiHandler } from 'trpc-nuxt'
|
||||
import { appRouter } from '../../trpc/routers'
|
||||
|
||||
export default createNuxtApiHandler({
|
||||
router: appRouter,
|
||||
createContext: async () => {
|
||||
return {}
|
||||
},
|
||||
onError({ error }) {
|
||||
console.log('Error', error)
|
||||
},
|
||||
})
|
||||
Reference in New Issue
Block a user