mirror of
https://github.com/ArthurDanjou/trpc-nuxt.git
synced 2026-01-14 20:19:33 +01:00
Example: Added a basic example with a product call
This commit is contained in:
9
examples/basic-example/server/api/trpc/[trpc].ts
Normal file
9
examples/basic-example/server/api/trpc/[trpc].ts
Normal file
@@ -0,0 +1,9 @@
|
||||
import { createNuxtApiHandler } from 'trpc-nuxt'
|
||||
import { appRouter } from '../../trpc/routers'
|
||||
import { createContext } from '../../trpc/context'
|
||||
|
||||
// export API handler
|
||||
export default createNuxtApiHandler({
|
||||
router: appRouter,
|
||||
createContext,
|
||||
})
|
||||
Reference in New Issue
Block a user