import handler from template

This commit is contained in:
Robert Soriano
2022-05-16 08:22:54 -07:00
parent b0eab95b47
commit e9224c3c5e
6 changed files with 78 additions and 45 deletions

View File

@@ -1,7 +0,0 @@
// generated by trpc-nuxt
import { createTRPCHandler } from 'trpc-nuxt/handler'
import * as functions from '../../fn'
export default createTRPCHandler({
router: functions.router
})

View File

@@ -1,16 +1,11 @@
// generated by trpc-nuxt
import * as trpc from '@trpc/server'
import { z } from 'zod'
export const router = trpc
.router()
.query('getUser', {
input: z.object({ name: z.string().min(5) }),
async resolve(req) {
return { id: 1, name: req.input.name }
},
})
.query('hello', {
resolve: () => 'world',
})
export type Router = typeof router