update router location

This commit is contained in:
Robert Soriano
2022-05-17 16:50:41 -07:00
parent 81d8497f20
commit 2f19d63e5c
4 changed files with 7 additions and 13 deletions

View File

@@ -38,7 +38,7 @@ export default defineNuxtModule<ModuleOptions>({
await fs.writeFile(clientPath, `
import * as trpc from '@trpc/client'
import { createTRPCComposables } from 'trpc-nuxt/client'
import { router } from '~/server/fn'
import type { router } from '~/trpc'
const client = trpc.createTRPCClient<typeof router>({
url: process.browser ? '/trpc' : 'http://localhost:3000/trpc',
@@ -61,7 +61,7 @@ export default defineNuxtModule<ModuleOptions>({
await fs.writeFile(handlerPath, `
import { createTRPCHandler } from 'trpc-nuxt/api'
import * as functions from '~/server/fn'
import * as functions from '~/trpc'
export default createTRPCHandler({
router: functions.router,