make trpc-nuxt flexible by exporting server and client functions instead of nuxt modules

This commit is contained in:
Robert Soriano
2022-10-29 21:50:27 -07:00
parent bad2de134b
commit ae920a37fd
20 changed files with 713 additions and 780 deletions

View 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)
},
})