mirror of
https://github.com/ArthurDanjou/trpc-nuxt.git
synced 2026-01-14 12:14:40 +01:00
27 lines
561 B
TypeScript
27 lines
561 B
TypeScript
import { initTRPC } from '@trpc/server'
|
|
import type { Context } from './context'
|
|
|
|
const t = initTRPC.context<Context>().create()
|
|
|
|
/**
|
|
* Create a router
|
|
* @see https://trpc.io/docs/v10/router
|
|
*/
|
|
export const router = t.router
|
|
|
|
/**
|
|
* Create an unprotected procedure
|
|
* @see https://trpc.io/docs/v10/procedures
|
|
**/
|
|
export const publicProcedure = t.procedure
|
|
|
|
/**
|
|
* @see https://trpc.io/docs/v10/middlewares
|
|
*/
|
|
export const middleware = t.middleware
|
|
|
|
/**
|
|
* @see https://trpc.io/docs/v10/merging-routers
|
|
*/
|
|
export const mergeRouters = t.mergeRouters
|