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

@@ -1,32 +0,0 @@
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',
})
// optional
export const createContext = () => {
// ...
return {
/** context data */
}
}
// optional
export const responseMeta = () => {
// ...
return {
// { headers: ... }
}
}
export type Router = typeof router